summaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm47xx
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-01-02 19:27:22 +0100
committerRalf Baechle <ralf@linux-mips.org>2014-01-24 22:39:52 +0100
commit9cbeac05b63d4a886be25df77aad47c19eefd9d6 (patch)
treee6ca67e4730d773b542b62aa7c8db31c4ce71853 /arch/mips/bcm47xx
parent978e55d2d83b6006fe0801877526ae240d41fd36 (diff)
downloadop-kernel-dev-9cbeac05b63d4a886be25df77aad47c19eefd9d6.zip
op-kernel-dev-9cbeac05b63d4a886be25df77aad47c19eefd9d6.tar.gz
MIPS: BCM47XX: check length of serial console array
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6310/
Diffstat (limited to 'arch/mips/bcm47xx')
-rw-r--r--arch/mips/bcm47xx/serial.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/bcm47xx/serial.c b/arch/mips/bcm47xx/serial.c
index b8ef965..2f5bbd6 100644
--- a/arch/mips/bcm47xx/serial.c
+++ b/arch/mips/bcm47xx/serial.c
@@ -31,7 +31,8 @@ static int __init uart8250_init_ssb(void)
memset(&uart8250_data, 0, sizeof(uart8250_data));
- for (i = 0; i < mcore->nr_serial_ports; i++) {
+ for (i = 0; i < mcore->nr_serial_ports &&
+ i < ARRAY_SIZE(uart8250_data) - 1; i++) {
struct plat_serial8250_port *p = &(uart8250_data[i]);
struct ssb_serial_port *ssb_port = &(mcore->serial_ports[i]);
@@ -55,7 +56,8 @@ static int __init uart8250_init_bcma(void)
memset(&uart8250_data, 0, sizeof(uart8250_data));
- for (i = 0; i < cc->nr_serial_ports; i++) {
+ for (i = 0; i < cc->nr_serial_ports &&
+ i < ARRAY_SIZE(uart8250_data) - 1; i++) {
struct plat_serial8250_port *p = &(uart8250_data[i]);
struct bcma_serial_port *bcma_port;
bcma_port = &(cc->serial_ports[i]);
OpenPOWER on IntegriCloud