mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 15:47:36 +00:00
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 <stigge@antcom.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
d79550a7bc
commit
a48221a26e
1 changed files with 1 additions and 1 deletions
|
@ -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->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) {
|
if (!chip->buffer) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto exit_destroy;
|
goto exit_destroy;
|
||||||
|
|
Loading…
Reference in a new issue