From: Ian Abbott Date: Wed, 24 Mar 2010 12:54:35 +0000 (+0000) Subject: serial2002: Slight change to previous commit. If failed to allocate X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee5d725185e663211caafc28581eebabc35a9dc4;p=comedi.git serial2002: Slight change to previous commit. If failed to allocate 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. --- diff --git a/comedi/drivers/serial2002.c b/comedi/drivers/serial2002.c index cce06d61..7e74b35f 100644 --- a/comedi/drivers/serial2002.c +++ b/comedi/drivers/serial2002.c @@ -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);