]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: ni_670x: fix dereference of an invalid pointer
authorH Hartley Sweeten <hartleys@visionengravers.com>
Sat, 30 Jun 2012 00:39:45 +0000 (17:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2012 22:46:06 +0000 (15:46 -0700)
commit7ff25837d368f8038af8801501a03780ed40b414
treef9fd223ee8897c276f4277dc523a2080c016b255
parentbd9896f49f2cb80d154a7af3c343f21ce79672c7
staging: comedi: ni_670x: fix dereference of an invalid pointer

The attach if this driver can fail before the subdevices are
allocated. If the attach fails the comedi core will call the
detach routine to allow the driver to do it's cleanup.

We need to make sure that the subdevice allocation was successful
before trying to dereference subdevice[0] to free the allocated
range table list.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_670x.c