mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
usb: phy: am335x-control: check return value of bus_find_device
This fixes a potential null pointer dereference.
Cc: <[email protected]> # v3.16+
Fixes: d433201391 ("driver core: dev_get_drvdata: Don't check for NULL dev")
Acked-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: David Dueck <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
509d612b2f
commit
d0f347d628
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue