Revert "staging: comedi: drivers: Remove unneeded NULL check before kfree()"

This reverts commit 3545bee9b8.

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>
This commit is contained in:
Greg Kroah-Hartman 2016-03-10 19:35:54 -08:00
parent b44483e7be
commit 7bf777fbfe
1 changed files with 4 additions and 2 deletions

View File

@ -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 = {