]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
usb: common: usb-conn-gpio: fix NULL pointer dereference of charger
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 19 May 2021 06:39:44 +0000 (14:39 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 20 Sep 2021 13:39:43 +0000 (15:39 +0200)
commitbc38d9651b6f58cae1a4a3f7f662669f86110fa1
tree23187f7edeb67774715bb470b780a35c00f4bb76
parentaccf63b9c38320542b5b294b6adcbf5bfecf5159
usb: common: usb-conn-gpio: fix NULL pointer dereference of charger

BugLink: https://bugs.launchpad.net/bugs/1939738
[ Upstream commit 880287910b1892ed2cb38977893b947382a09d21 ]

When power on system with OTG cable, IDDIG's interrupt arises before
the charger registration, it will cause a NULL pointer dereference,
fix the issue by registering the power supply before requesting
IDDIG/VBUS irq.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1621406386-18838-1-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/usb/common/usb-conn-gpio.c