1
0
Fork 0
alistair23-linux/drivers/visorbus
Arnd Bergmann 11c759264c visorbus: fix uninitialized variable access
[ Upstream commit caf82f727e ]

The setup_crash_devices_work_queue function only partially initializes
the message it sends to chipset_init, leading to undefined behavior:

drivers/visorbus/visorchipset.c: In function 'setup_crash_devices_work_queue':
drivers/visorbus/visorchipset.c:333:6: error: '((unsigned char*)&msg.hdr.flags)[0]' is used uninitialized in this function [-Werror=uninitialized]
  if (inmsg->hdr.flags.response_expected)

Set up the entire structure, zero-initializing the 'response_expected'
flag.

This was apparently found by the patch that added the -O3 build option
in Kconfig.

Fixes: 12e364b9f0 ("staging: visorchipset driver to provide registration and other services")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200107202950.782951-1-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:36:47 +01:00
..
Kconfig
Makefile
controlvmchannel.h
vbuschannel.h
visorbus_main.c bus_find_device: Unify the match callback with class_find_device 2019-06-24 05:22:31 +02:00
visorbus_private.h
visorchannel.c
visorchipset.c visorbus: fix uninitialized variable access 2020-02-24 08:36:47 +01:00