mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
usb: musb: ux500: Fix NULL pointer dereference at system PM
The commit7d32cdef53("usb: musb: fail with error when no DMA controller set"), caused the core platform driver to correctly return an error code when fail probing. Unfurtante it also caused bug for a NULL pointer dereference, during system suspend for the ux500 driver. The reason is a lacking validation of the corresponding ->driver_data pointer, which won't be set when the musb core driver fails to probe (or haven't yet been probed). Fixes:7d32cdef53("usb: musb: fail with error when no DMA...") Acked-by: Linus Walleij <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
63b121e3a3
commit
79c5623f1c
1 changed files with 5 additions and 2 deletions
|
|
@ -348,7 +348,9 @@ static int ux500_suspend(struct device *dev)
|
|||
struct ux500_glue *glue = dev_get_drvdata(dev);
|
||||
struct musb *musb = glue_to_musb(glue);
|
||||
|
||||
usb_phy_set_suspend(musb->xceiv, 1);
|
||||
if (musb)
|
||||
usb_phy_set_suspend(musb->xceiv, 1);
|
||||
|
||||
clk_disable_unprepare(glue->clk);
|
||||
|
||||
return 0;
|
||||
|
|
@ -366,7 +368,8 @@ static int ux500_resume(struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
usb_phy_set_suspend(musb->xceiv, 0);
|
||||
if (musb)
|
||||
usb_phy_set_suspend(musb->xceiv, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue