Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: mv78xx0: fix possible PCI buffer overflow

gcc-7.0 reports a potential array overflow:

arch/arm/mach-mv78xx0/pcie.c: In function 'mv78xx0_pcie_preinit':
arch/arm/mach-mv78xx0/pcie.c:81:4: error: output may be truncated before the last format character [-Werror=format-truncation=]

I haven't checked if this can actually happen, but making the
array one 32-bit word longer addresses the warning and makes
it completely safe.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

authored by

Arnd Bergmann and committed by
Gregory CLEMENT
5de267b2 0c744ea4

+1 -1
+1 -1
arch/arm/mach-mv78xx0/pcie.c
··· 29 29 u8 root_bus_nr; 30 30 void __iomem *base; 31 31 spinlock_t conf_lock; 32 - char mem_space_name[16]; 32 + char mem_space_name[20]; 33 33 struct resource res; 34 34 }; 35 35