summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/comedi_fops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index f496f4d96c83..c2a32cf95a82 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1195,7 +1195,6 @@ static int do_cmd_ioctl(struct comedi_device *dev,
goto cleanup;
}
- kfree(async->cmd.chanlist);
async->cmd = cmd;
async->cmd.data = NULL;
/* load channel/gain list */
@@ -2033,6 +2032,8 @@ static void do_become_nonbusy(struct comedi_device *dev,
if (async) {
comedi_reset_async_buf(async);
async->inttrig = NULL;
+ kfree(async->cmd.chanlist);
+ async->cmd.chanlist = NULL;
} else {
dev_err(dev->class_dev,
"BUG: (?) do_become_nonbusy called with async=NULL\n");
OpenPOWER on IntegriCloud