linux/drivers/hid/intel-ish-hid
Arnd Bergmann 1260662fa3 HID: intel_ish-hid: fix potential uninitialized data usage
gcc points out an uninialized pointer dereference that could happen
if we ever get to recv_ishtp_cl_msg_dma() or recv_ishtp_cl_msg()
with an empty &dev->read_list:

drivers/hid/intel-ish-hid/ishtp/client.c: In function 'recv_ishtp_cl_msg_dma':
drivers/hid/intel-ish-hid/ishtp/client.c:1049:3: error: 'cl' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The warning only appeared in very few randconfig builds, as the
spinlocks tend to prevent gcc from tracing the variables. I only
saw it in configurations that had neither SMP nor LOCKDEP enabled.

As we can see, we only enter the case if 'complete_rb' is non-NULL,
and then 'cl' is known to point to complete_rb->cl. Adding another
initialization to the same pointer is harmless here and makes it
clear to the compiler that the behavior is well-defined.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-05-30 14:11:52 +02:00
..
ipc Merge branches 'for-4.10/upstream-fixes', 'for-4.11/intel-ish', 'for-4.11/mayflash', 'for-4.11/microsoft', 'for-4.11/rmi', 'for-4.11/upstream' and 'for-4.11/wacom' into for-linus 2017-02-20 15:01:57 +01:00
ishtp HID: intel_ish-hid: fix potential uninitialized data usage 2017-05-30 14:11:52 +02:00
ishtp-hid-client.c HID: intel-ish-hid: ISH HID client driver 2016-08-17 11:13:08 +02:00
ishtp-hid.c HID: intel-ish-hid: format 32-bit integers with %X 2017-01-02 13:16:32 +01:00
ishtp-hid.h HID: intel-ish-hid: ISH HID client driver 2016-08-17 11:13:08 +02:00
Kconfig
Makefile HID: intel-ish-hid: ISH HID client driver 2016-08-17 11:13:08 +02:00