From ee5d725185e663211caafc28581eebabc35a9dc4 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 24 Mar 2010 12:54:35 +0000 Subject: [PATCH] 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. --- comedi/drivers/serial2002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.26.2