projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
509d612
)
usb: phy: am335x-control: check return value of bus_find_device
author
David Dueck
<davidcdueck@googlemail.com>
Sun, 8 Feb 2015 15:29:30 +0000
(16:29 +0100)
committer
Felipe Balbi
<balbi@ti.com>
Tue, 10 Mar 2015 21:28:44 +0000
(16:28 -0500)
This fixes a potential null pointer dereference.
Cc: <stable@vger.kernel.org> # v3.16+
Fixes:
d4332013919a
("driver core: dev_get_drvdata: Don't check for NULL dev")
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David Dueck <davidcdueck@googlemail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/phy/phy-am335x-control.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/phy/phy-am335x-control.c
b/drivers/usb/phy/phy-am335x-control.c
index 403fab772724825b16ecfd8446ab9d95386bb1cc..7b3035ff94347a519a9d54f27c45108aaaca0e9f 100644
(file)
--- a/
drivers/usb/phy/phy-am335x-control.c
+++ b/
drivers/usb/phy/phy-am335x-control.c
@@
-126,6
+126,9
@@
struct phy_control *am335x_get_phy_control(struct device *dev)
return NULL;
dev = bus_find_device(&platform_bus_type, NULL, node, match);
+ if (!dev)
+ return NULL;
+
ctrl_usb = dev_get_drvdata(dev);
if (!ctrl_usb)
return NULL;