Archived
14
0
Fork 0

Staging: comedi: serial2002: Fix memory leak on detach

The comedi device 'detach' method for the serial2002 driver has an
off-by-one error in its loop for freeing data belonging to its
subdevices.  Fix it.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Ian Abbott 2010-05-19 14:10:02 +01:00 committed by Greg Kroah-Hartman
parent 9e7f225688
commit fa3b5d9ab0

View file

@ -903,7 +903,7 @@ static int serial2002_detach(struct 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);