Skip to content

Commit e890afc

Browse files
tititiou36vegard
authored andcommitted
MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup()
[ Upstream commit 89c4b58 ] When calling spi_register_board_info(), we should pass the number of elements in 'db1200_spi_devs', not 'db1200_i2c_devs'. Fixes: 63323ec ("MIPS: Alchemy: Extended DB1200 board support.") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit c6d7d05) Signed-off-by: Vegard Nossum <[email protected]>
1 parent 5ce237e commit e890afc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/alchemy/devboards/db1200.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ int __init db1200_dev_setup(void)
858858
i2c_register_board_info(0, db1200_i2c_devs,
859859
ARRAY_SIZE(db1200_i2c_devs));
860860
spi_register_board_info(db1200_spi_devs,
861-
ARRAY_SIZE(db1200_i2c_devs));
861+
ARRAY_SIZE(db1200_spi_devs));
862862

863863
/* SWITCHES: S6.8 I2C/SPI selector (OFF=I2C ON=SPI)
864864
* S6.7 AC97/I2S selector (OFF=AC97 ON=I2S)

0 commit comments

Comments
 (0)