Skip to content

Commit

Permalink
Staging: comedi: serial2002: Fix memory leak on detach
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 17, 2010
1 parent 9e7f225 commit fa3b5d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/serial2002.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fa3b5d9

Please sign in to comment.