spi: bcm2835: add a sentinel at the end of the lookup array
[linux-2.6-microblaze.git] / drivers / spi / spi-bcm2835.c
index c9078fe..e709887 100644 (file)
@@ -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;