]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtd: ichxrom: maybe-uninitialized with gcc-4.9
authorArnd Bergmann <arnd@arndb.de>
Mon, 24 Oct 2016 15:28:35 +0000 (17:28 +0200)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:29 +0000 (10:28 -0500)
commit5cf0b5600f594aefc7d64631ad7e28bbc73cf800
tree16e0ce6f1a9e99e43322329f645173ca721bb9df
parentb3f049b421a764156135e4ffb7a7ce08c43a279f
mtd: ichxrom: maybe-uninitialized with gcc-4.9

[ Upstream commit e70dda0868fad0f74c46df21f7f45fec24f29879 ]

pci_read_config_word() might fail and not initialize its output,
as pointed out by older versions of gcc when using the -Wmaybe-unintialized
flag:

drivers/mtd/maps/ichxrom.c: In function ‘ichxrom_cleanup’:
drivers/mtd/maps/ichxrom.c:63:2: error: ‘word’ is used uninitialized in this function [-Werror=uninitialized]

This is apparently a correct warning, though it does not show up
with newer compilers. Changing the code to not attempt to write
back uninitialized data into PCI config space is a correct
fix for the problem and avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/mtd/maps/ichxrom.c