summaryrefslogtreecommitdiff
path: root/drivers/comedi/drivers.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/comedi/drivers.c')
-rw-r--r--drivers/comedi/drivers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/comedi/drivers.c b/drivers/comedi/drivers.c
index d4e2ed709bfc..376130bfba8a 100644
--- a/drivers/comedi/drivers.c
+++ b/drivers/comedi/drivers.c
@@ -177,7 +177,8 @@ static void comedi_device_detach_cleanup(struct comedi_device *dev)
dev->n_subdevices = 0;
}
kfree(dev->private);
- kfree(dev->pacer);
+ if (!IS_ERR(dev->pacer))
+ kfree(dev->pacer);
dev->private = NULL;
dev->pacer = NULL;
dev->driver = NULL;