serial2002: Fix memory leak on 'detach' (off-by-one error in subdevice loop).
authorIan Abbott <abbotti@mev.co.uk>
Tue, 18 May 2010 16:28:07 +0000 (16:28 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Tue, 18 May 2010 16:28:07 +0000 (16:28 +0000)
comedi/drivers/serial2002.c

index 7e74b35fa0c422bea2d24bd190cd96deedd6341d..3cb817a1ac05f99a0a3ce8621e857260e4caae95 100644 (file)
@@ -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);