Skip to content
Commit 60593df6 authored by Luo Jiaxing's avatar Luo Jiaxing Committed by Bartosz Golaszewski
Browse files

gpio: dwapb: fix NULL pointer dereference at dwapb_gpio_suspend()



Following Calltrace is found when running echo freeze > /sys/power/state.

[  272.755506] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
[  272.755585] Call trace:
[  272.755587]  dwapb_gpio_suspend+0x18/0x318
[  272.755588]  pm_generic_suspend+0x2c/0x48
[  272.755595]  acpi_subsys_suspend+0x60/0x70
[  272.755599]  dpm_run_callback.isra.18+0x40/0xe0
[  272.755601]  __device_suspend+0xf4/0x360

The reason is platform_set_drvdata() is deleted, and dwapb_gpio_suspend()
get *gpio by dev_get_drvdata().

Fixes: feeaefd3 ("gpio: dwapb: Use resource managed GPIO-chip add data method")
Signed-off-by: default avatarLuo Jiaxing <luojiaxing@huawei.com>
Acked-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 0ac22098
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment