From c4194bb70ada4d7efa7b056d2c0b945494c3ee57 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 19 Oct 2005 02:38:01 +0000 Subject: [PATCH] Fix memory leak noted by "Michael Brooks" --- comedi/comedi_fops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 8db0b10d..83cf1e86 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -893,11 +893,10 @@ static int do_cmd_ioctl(comedi_device *dev,void *arg,void *file) } async->cmd=user_cmd; - async->cmd.chanlist=NULL; async->cmd.data=NULL; /* load channel/gain list */ - /* we should have this already allocated */ + 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"); -- 2.26.2