From 74b11bef0cbcd22a5b92d0c8512b0f55a6707e21 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Tue, 18 May 2010 16:28:07 +0000 Subject: [PATCH] serial2002: Fix memory leak on 'detach' (off-by-one error in subdevice loop). --- comedi/drivers/serial2002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comedi/drivers/serial2002.c b/comedi/drivers/serial2002.c index 7e74b35f..3cb817a1 100644 --- a/comedi/drivers/serial2002.c +++ b/comedi/drivers/serial2002.c @@ -872,7 +872,7 @@ static int serial2002_detach(comedi_device * dev) int i; printk("comedi%d: serial2002: remove\n", dev->minor); - for (i = 0; i < 4; i++) { + for (i = 0; i < 5; i++) { s = &dev->subdevices[i]; if (s->maxdata_list) { kfree(s->maxdata_list); -- 2.26.2