From: Frank Mori Hess Date: Wed, 19 Oct 2005 03:10:32 +0000 (+0000) Subject: free async->cmd.chanlist before it gets blown away by user's cmd X-Git-Tag: r0_7_71~129 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8e018369a2c7d60ef66e5441eeda8b2ed91e967e;p=comedi.git free async->cmd.chanlist before it gets blown away by user's cmd --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 83cf1e86..1c88bd14 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -892,11 +892,10 @@ static int do_cmd_ioctl(comedi_device *dev,void *arg,void *file) goto cleanup; } + if(async->cmd.chanlist) kfree(async->cmd.chanlist); async->cmd=user_cmd; async->cmd.data=NULL; - /* load channel/gain list */ - if(async->cmd.chanlist) kfree(async->cmd.chanlist); async->cmd.chanlist=kmalloc(async->cmd.chanlist_len*sizeof(int),GFP_KERNEL); if(!async->cmd.chanlist){ DPRINTK("allocation failed\n");