mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-10 04:42:22 -05:00
usb: chipidea: usbmisc: fix a potential race condition
This fixes a potential race condition where the ci13xxx_imx glue code could be fast enough to call one of the usbmisc_ops before he got a valid value on the static usbmisc pointer. To fix that we first set usbmisc, then call usbmisc_set_ops(). Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
d48a24dbc0
commit
00b9a1f97d
1 changed files with 2 additions and 2 deletions
|
|
@ -116,14 +116,14 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
usbmisc = data;
|
||||
ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
|
||||
if (ret) {
|
||||
usbmisc = NULL;
|
||||
clk_disable_unprepare(data->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
usbmisc = data;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue