serial2002: Slight change to previous commit. If failed to allocate
authorIan Abbott <abbotti@mev.co.uk>
Wed, 24 Mar 2010 12:54:35 +0000 (12:54 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Wed, 24 Mar 2010 12:54:35 +0000 (12:54 +0000)
maxdata_list or range_table_list for a subdevice during the 'open' method,
free these for all subdevices as they may be left over from a previous
open.

comedi/drivers/serial2002.c

index cce06d61e972eb21b2fb5e604b17e00cc9cdeb76..7e74b35fa0c422bea2d24bd190cd96deedd6341d 100644 (file)
@@ -651,7 +651,7 @@ static int serial_2002_open(comedi_device * dev)
                        /* Failed to allocate maxdata_list or range_table_list
                         * for a subdevice that needed it. */
                        result = -ENOMEM;
-                       for ( ; i >= 0; i--) {
+                       for (i = 0; i <= 4; i++) {
                                comedi_subdevice *s = &dev->subdevices[i];
 
                                kfree(s->maxdata_list);