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

2016-02-18 Thread Linus Walleij
On Tue, Feb 16, 2016 at 11:22 AM, Geert Uytterhoeven 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:

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

2016-02-16 Thread Geert Uytterhoeven
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: Unable to handle kernel NULL pointer dereference at virtual address ...