diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-10 19:35:54 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-10 19:35:54 -0800 |
commit | 7bf777fbfe7926398063bf669c672e52b28b69d2 (patch) | |
tree | b9cef82ea9d261a86809aa7ae37d6e5de71e3649 /drivers/staging/comedi | |
parent | b44483e7be1a713ed1f522696dc48909487fa794 (diff) | |
download | linux-7bf777fbfe7926398063bf669c672e52b28b69d2.tar.bz2 |
Revert "staging: comedi: drivers: Remove unneeded NULL check before kfree()"
This reverts commit 3545bee9b8ec00ba733e17363f494c8761fb5e49.
It's not correct.
Reported-by: Hartley Sweeten <HartleyS@visionengravers.com>
Cc: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pci224.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index 656df1abce89..cac011fdd375 100644 --- a/drivers/staging/comedi/drivers/amplc_pci224.c +++ b/drivers/staging/comedi/drivers/amplc_pci224.c @@ -1096,8 +1096,10 @@ static void pci224_detach(struct comedi_device *dev) struct pci224_private *devpriv = dev->private; comedi_pci_detach(dev); - kfree(devpriv->ao_scan_vals); - kfree(devpriv->ao_scan_order); + if (devpriv) { + kfree(devpriv->ao_scan_vals); + kfree(devpriv->ao_scan_order); + } } static struct comedi_driver amplc_pci224_driver = { |