mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
usb: chipidea: host: fix NULL ptr dereference during shutdown
After commitb09b5224fe("usb: chipidea: implement platform shutdown callback") and commit43a404577a("usb: chipidea: host: set host to be null after hcd is freed") a NULL pointer dereference is caused on i.MX23 during shutdown. So ensure that role is set to CI_ROLE_END and we finish interrupt handling before the hcd is deallocated. This avoids the NULL pointer dereference. Suggested-by: Alan Stern <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Fixes:b09b5224fe("usb: chipidea: implement platform shutdown callback") Signed-off-by: Peter Chen <[email protected]>
This commit is contained in:
parent
b76032396d
commit
991d5add50
1 changed files with 2 additions and 0 deletions
|
|
@ -188,6 +188,8 @@ static void host_stop(struct ci_hdrc *ci)
|
|||
|
||||
if (hcd) {
|
||||
usb_remove_hcd(hcd);
|
||||
ci->role = CI_ROLE_END;
|
||||
synchronize_irq(ci->irq);
|
||||
usb_put_hcd(hcd);
|
||||
if (ci->platdata->reg_vbus && !ci_otg_is_fsm_mode(ci) &&
|
||||
(ci->platdata->flags & CI_HDRC_TURN_VBUS_EARLY_ON))
|
||||
|
|
|
|||
Loading…
Reference in a new issue