Skip to content
Commit 969f07b4 authored by Josh Cartwright's avatar Josh Cartwright Committed by Linus Walleij
Browse files

gpio: use kzalloc to allocate gpio_device



The use of kmalloc() to allocate the gpio_device leaves the contained struct
device object in an unknown state.  Calling dev_set_name() on a struct device
of unknown state can trigger the free() of an invalid pointer, as seen in the
following backtrace (collected by Tony Lindgren):

  kfree
  kobject_set_name_vargs
  dev_set_name
  gpiochip_add_data
  omap_gpio_probe
  platform_drv_probe
  ...

Reported-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reported-by: default avatarMichael Welling <mwelling@ieee.org>
Reported-by: default avatarTony Lindgren <tony@atomide.com>
Tested-by: default avatarMichael Welling <mwelling@ieee.org>
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarJosh Cartwright <joshc@ni.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent aaf2b3af
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment