kernel_optimize_test/drivers/input
Jesper Juhl 39de52104d Input: serio HIL MLC - don't deref null, don't leak and return proper error
While reviewing various users of kernel memory allocation functions I came
across drivers/input/serio/hil_mlc.c::hil_mlc_register() and noticed that:

 - it calls kzalloc() but fails to check for a NULL return before use.
 - it makes several allocations and if one fails it doesn't free the
   previous ones.
 - It doesn't return -ENOMEM in the failed memory allocation case (it just
   crashes).

This patch corrects all of the above and also reworks the only caller of
this function that I could find
(drivers/input/serio/hp_sdc_mlc.c::hp_sdc_mlc_out()) so that it now checks
the return value of hil_mlc_register() and properly propagates it on
failure and I also restructured the code to remove some labels and goto's
to make it, IMHO nicer to read.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Tested-by: Helge Deller <deller@gmx.de>
Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-11-20 13:38:18 -08:00
..
gameport Input: gameport - convert to use common workqueue instead of a thread 2010-11-18 00:25:49 -08:00
joystick Input: xpad - ensure xpad->bulk_out is initialized before submitting urb 2010-11-18 00:16:44 -08:00
keyboard Input: add support for keyboards on ST SPEAr platform 2010-11-19 12:43:25 -08:00
misc Input: pcf_keypad - convert to dev_op_ops 2010-11-11 22:02:57 -08:00
mouse Input: hgpk - fix powersave mode 2010-11-15 01:33:59 -08:00
serio Input: serio HIL MLC - don't deref null, don't leak and return proper error 2010-11-20 13:38:18 -08:00
tablet Input: acecad - fix a memory leak in usb_acecad_probe error path 2010-11-10 23:07:03 -08:00
touchscreen Input: qt602240_ts - fix wrong sizeof in object table allocation 2010-11-18 00:17:12 -08:00
apm-power.c
evbug.c
evdev.c
ff-core.c
ff-memless.c
fixp-arith.h
input-compat.c
input-compat.h
input-polldev.c
input.c Input: do not pass injected events back to the originating handler 2010-11-11 01:01:26 -08:00
joydev.c
Kconfig
Makefile
mousedev.c
sparse-keymap.c
xen-kbdfront.c