projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05b4496
)
usb: dwc3: fix possible NULL pointer dereference for rockchip plat
author
Wu Liang feng
<wulf@rock-chips.com>
Thu, 25 Aug 2016 12:37:33 +0000
(20:37 +0800)
committer
Huang, Tao
<huangtao@rock-chips.com>
Thu, 1 Sep 2016 04:01:04 +0000
(12:01 +0800)
Change-Id: I2afb1fa38ae6e76b8db397bda59fd9fbafe9a53b
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
drivers/usb/dwc3/dwc3-rockchip.c
patch
|
blob
|
history
diff --git
a/drivers/usb/dwc3/dwc3-rockchip.c
b/drivers/usb/dwc3/dwc3-rockchip.c
index b188514435367aa70df0136ec1f44c058c9bbc33..744e0e1712735e927ca82786266b4d6cc0ff3eb7 100644
(file)
--- a/
drivers/usb/dwc3/dwc3-rockchip.c
+++ b/
drivers/usb/dwc3/dwc3-rockchip.c
@@
-80,6
+80,9
@@
static void dwc3_rockchip_otg_extcon_evt_work(struct work_struct *work)
int ret;
u32 reg;
+ if (!dwc)
+ return;
+
if (extcon_get_cable_state_(edev, EXTCON_USB) > 0) {
if (dwc->connected)
return;
@@
-318,6
+321,11
@@
static int dwc3_rockchip_probe(struct platform_device *pdev)
}
rockchip->dwc = platform_get_drvdata(child_pdev);
+ if (!rockchip->dwc) {
+ dev_err(dev, "failed to get drvdata dwc3\n");
+ ret = -ENODEV;
+ goto err3;
+ }
if (rockchip->edev) {
pm_runtime_set_autosuspend_delay(&child_pdev->dev,