summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/amplc_pci224.c6
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 = {