]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: sanity check num_subdevices parameter in comedi_alloc_subdevices
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 12 Jun 2012 18:57:45 +0000 (11:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2012 21:44:03 +0000 (14:44 -0700)
commitc6dd132fe6a60c621eee8d2002612392d5d1019a
treed3d3f3d65a121e9d2c64b3177ea852f5914ea729
parent31fda30dbf11772f8e7cb81cffb9da433532c5a1
staging: comedi: sanity check num_subdevices parameter in comedi_alloc_subdevices

It's possible for a couple of the comedi drivers to incorrectly call
comedi_alloc_subdevices with num_subdevices = 0. Add a sanity check
before doing the kcalloc.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbot@mev.co.uk>
Cc: Frank Mori Hess <kmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c