Skip to content

Commit

Permalink
ARM: mv78xx0: fix possible PCI buffer overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and Gregory CLEMENT committed Jan 27, 2017
1 parent 0c744ea commit 5de267b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-mv78xx0/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct pcie_port {
u8 root_bus_nr;
void __iomem *base;
spinlock_t conf_lock;
char mem_space_name[16];
char mem_space_name[20];
struct resource res;
};

Expand Down

0 comments on commit 5de267b

Please sign in to comment.