kernel-hacking-2024-linux-s.../drivers/hid
Julia Lawall 8052ee5f5f HID: drivers/hid/hid-roccat.c: eliminate a null pointer dereference
It is not possible to take the lock in device if device is NULL.
The mutex_lock is thus moved after the NULL test.  New error handling
labels are added at the end to differentiate between the cases where
different sets of locks should be unlocks, and between whether or not
reader should be freed (only on error).

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

if (E == NULL)
{
  ... when != if (E == NULL || ...) S1 else S2
      when != E = E1
*E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-11-01 15:13:08 +01:00
..
usbhid Merge branch 'upstream' into for-linus 2011-10-25 09:59:04 +02:00
hid-a4tech.c
hid-apple.c HID: hid-apple: add device ID of another wireless aluminium 2011-10-28 18:54:56 +02:00
hid-axff.c HID: ACRUX - handle gamepads with different report layout 2011-08-04 15:25:34 +02:00
hid-belkin.c
hid-cherry.c
hid-chicony.c
hid-core.c HID: hid-apple: add device ID of another wireless aluminium 2011-10-28 18:54:56 +02:00
hid-cypress.c
hid-debug.c HID: hid-debug: Show application usage for each collection. 2011-08-16 11:37:29 +02:00
hid-dr.c
hid-elecom.c
hid-emsff.c HID: emsff: properly handle emsff_init failure 2011-07-20 11:55:18 +02:00
hid-ezkey.c
hid-gaff.c
hid-gyration.c
hid-holtekff.c HID: add FF support for Holtek On Line Grip based gamepads 2011-06-27 12:40:00 +02:00
hid-ids.h HID: hid-apple: add device ID of another wireless aluminium 2011-10-28 18:54:56 +02:00
hid-input.c HID: add autodetection of multitouch devices 2011-09-26 14:18:18 +02:00
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-lg.c HID: lg4ff - Add range setting support and sysfs interface 2011-08-04 16:45:55 +02:00
hid-lg.h HID: lg4ff - Fix misleading info in Kconfig 2011-08-04 16:45:55 +02:00
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c HID: hid-lg4ff: add a kfree() to an error path 2011-08-23 10:44:44 +02:00
hid-lgff.c HID: lg4ff - Move handling of Logitech wheels to lg4ff driver 2011-08-04 16:45:55 +02:00
hid-logitech-dj.c HID: hid-logitech-dj: fix off by one 2011-09-20 16:09:22 +02:00
hid-logitech-dj.h HID: hid-logitech-dj: fix off by one 2011-09-20 16:09:22 +02:00
hid-magicmouse.c HID: hid-magicmouse: Magic Trackpad has 1 button, not 2 2011-10-21 10:13:55 +02:00
hid-microsoft.c HID: fix horizontal wheel for ms comfort mouse 4500 2011-07-12 10:31:56 +02:00
hid-monterey.c
hid-multitouch.c HID: multitouch: decide if hid-multitouch needs to handle mt devices 2011-09-26 14:19:02 +02:00
hid-ntrig.c
hid-ortek.c
hid-petalynx.c
hid-picolcd.c
hid-pl.c
hid-primax.c HID: support primax keyboards violating USB HID spec 2011-10-17 17:04:41 +02:00
hid-prodikeys.c HID: prodikeys: kfree() NULL pointer cleanup 2011-08-04 23:51:29 +02:00
hid-quanta.c
hid-roccat-arvo.c HID: roccat: fix NULL pointer dereference, add range checks 2011-06-13 13:06:23 +02:00
hid-roccat-arvo.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-common.c HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-common.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-kone.c HID: roccat: Kone now reports external profile changes via roccat device 2011-09-07 13:38:28 +02:00
hid-roccat-kone.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-koneplus.c HID: roccat: fix NULL pointer dereference, add range checks 2011-06-13 13:06:23 +02:00
hid-roccat-koneplus.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-kovaplus.c HID: roccat: Kovaplus now reports external profile changes via roccat device 2011-09-07 13:38:27 +02:00
hid-roccat-kovaplus.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-pyra.c HID: roccat: Pyra now reports external profile changes via roccat device 2011-09-07 13:38:27 +02:00
hid-roccat-pyra.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat.c HID: drivers/hid/hid-roccat.c: eliminate a null pointer dereference 2011-11-01 15:13:08 +01:00
hid-samsung.c
hid-sjoy.c HID: Add device IDs for more SJOY adapters 2011-10-21 01:01:45 +02:00
hid-sony.c HID: hid-sony: fix endiannes of Sixaxis accel/gyro values 2011-06-13 13:21:30 +02:00
hid-speedlink.c HID: Add driver to fix Speedlink VAD Cezanne support 2011-06-08 09:45:37 +02:00
hid-sunplus.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-uclogic.c HID: uclogic: Add support for UC-Logic WP1062 2011-07-11 14:37:24 +02:00
hid-wacom.c Merge branch 'upstream-fixes' into for-linus 2011-10-25 09:58:12 +02:00
hid-waltop.c
hid-wiimote.c HID: wiimote: Add MAINTAINERS entry 2011-09-07 13:25:18 +02:00
hid-zpff.c
hid-zydacron.c HID: zydacron: kfree() NULL pointer cleanup 2011-08-04 23:51:29 +02:00
hidraw.c Merge branch 'upstream' into for-linus 2011-10-25 09:59:04 +02:00
Kconfig Merge branch 'upstream' into for-linus 2011-10-25 09:59:04 +02:00
Makefile Merge branch 'upstream' into for-linus 2011-10-25 09:59:04 +02:00