From: Roland Stigge Date: Tue, 16 Oct 2012 13:24:01 +0000 (+0200) Subject: gpio-74x164: Fix buffer allocation size X-Git-Tag: v3.7-rc4~21^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a48221a26e4914b7e2d8a1749b6115212bac8bee;p=profile%2Fivi%2Fkernel-x86-ivi.git gpio-74x164: Fix buffer allocation size 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 Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c index ed3e551..f05e542 100644 --- a/drivers/gpio/gpio-74x164.c +++ b/drivers/gpio/gpio-74x164.c @@ -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;