Commit 7bf777fb authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

This reverts commit 3545bee9.

It's not correct.
Reported-by: default avatarHartley Sweeten <HartleyS@visionengravers.com>
Cc: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b44483e7
...@@ -1096,8 +1096,10 @@ static void pci224_detach(struct comedi_device *dev) ...@@ -1096,8 +1096,10 @@ static void pci224_detach(struct comedi_device *dev)
struct pci224_private *devpriv = dev->private; struct pci224_private *devpriv = dev->private;
comedi_pci_detach(dev); comedi_pci_detach(dev);
kfree(devpriv->ao_scan_vals); if (devpriv) {
kfree(devpriv->ao_scan_order); kfree(devpriv->ao_scan_vals);
kfree(devpriv->ao_scan_order);
}
} }
static struct comedi_driver amplc_pci224_driver = { static struct comedi_driver amplc_pci224_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment