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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 12:09:54 +0000 (14:09 +0200)
commit880287910b1892ed2cb38977893b947382a09d21
tree3a58ddb30cd85befe6da1e9474d990d5d2038d3b
parentc63fef4c4302f5d41945f5362ff0cf556cb6db19
usb: common: usb-conn-gpio: fix NULL pointer dereference of charger

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>
drivers/usb/common/usb-conn-gpio.c