Staging: comedi: serial2002: handle allocation failures on 'open'
authorIan Abbott <abbotti@mev.co.uk>
Wed, 19 May 2010 13:10:01 +0000 (14:10 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Jun 2010 20:28:56 +0000 (13:28 -0700)
commit9e7f2256883c954691e5d395d471e0f125f6b30b
treed07abf22d26b8842554bab8dd1343f80e2f77fc3
parent3c17ba0743d75f9888d905ddf9f8551c7dd36493
Staging: comedi: serial2002: handle allocation failures on 'open'

The comedi device 'open' method for the serial2002 driver frees any old
'maxdata_list' and 'range_table_list' arrays belonging to a subdevice
and allocates them again, but was missing checks for allocation failure.

If an allocation fails, free the 'maxdata_list' and 'range_table_list'
arrays for all subdevices and return an error.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/serial2002.c