diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index c9078fee3662..e709887eb2a9 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1299,7 +1299,7 @@ static int bcm2835_spi_setup(struct spi_device *spi) * More on the problem that it addresses: * https://www.spinics.net/lists/linux-gpio/msg36218.html */ - lookup = kzalloc(struct_size(lookup, table, 1), GFP_KERNEL); + lookup = kzalloc(struct_size(lookup, table, 2), GFP_KERNEL); if (!lookup) { ret = -ENOMEM; goto err_cleanup;