Commit 00b9a1f9 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by Greg Kroah-Hartman

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: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d48a24db
...@@ -116,14 +116,14 @@ static int usbmisc_imx_probe(struct platform_device *pdev) ...@@ -116,14 +116,14 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
return ret; return ret;
} }
usbmisc = data;
ret = usbmisc_set_ops(&imx6q_usbmisc_ops); ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
if (ret) { if (ret) {
usbmisc = NULL;
clk_disable_unprepare(data->clk); clk_disable_unprepare(data->clk);
return ret; return ret;
} }
usbmisc = data;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment