Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1337636

Re: [PATCH -next] gpio: Use kzalloc() to allocate struct gpio_device to fix crash

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH -next] gpio: Use kzalloc() to allocate struct gpio_device to fix crash
Date 2016-02-18 20:50 +0100
Message-ID <r3CKm-23z-13@gated-at.bofh.it> (permalink)
References <r2L3k-6zR-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 16, 2016 at 11:22 AM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:

> gpiochip_add_data() allocates the struct gpio_device using kmalloc(),
> which doesn't zero the returned memory.
>
> Hence when calling dev_set_name(), it may try to free a bogus old name,
> causing a crash:

Ooops got two patches to this independently and applied the other one,
I tagged your name onto the Reported-by now. Thanks!

Yours,
Linus Walleij

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH -next] gpio: Use kzalloc() to allocate struct gpio_device to fix crash Geert Uytterhoeven <geert+renesas@glider.be> - 2016-02-16 11:30 +0100
  Re: [PATCH -next] gpio: Use kzalloc() to allocate struct gpio_device  to fix crash Linus Walleij <linus.walleij@linaro.org> - 2016-02-18 20:50 +0100

csiph-web