]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
gpio-74x164: Fix buffer allocation size
authorRoland Stigge <stigge@antcom.de>
Tue, 16 Oct 2012 13:24:01 +0000 (15:24 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 16 Oct 2012 17:34:43 +0000 (19:34 +0200)
The new registers handling in the gpio-74x164 driver allocates chip->registers
* 8 bytes where only one byte per register is necessary. This patch fixes this.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-74x164.c

index ed3e55161bdc5bacbd0409a8a728f161872671c9..f05e54258ffb0a7c1b62eb54be11f2f8ed9486d8 100644 (file)
@@ -153,7 +153,7 @@ static int __devinit gen_74x164_probe(struct spi_device *spi)
        }
 
        chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers;
-       chip->buffer = devm_kzalloc(&spi->dev, chip->gpio_chip.ngpio, GFP_KERNEL);
+       chip->buffer = devm_kzalloc(&spi->dev, chip->registers, GFP_KERNEL);
        if (!chip->buffer) {
                ret = -ENOMEM;
                goto exit_destroy;