diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-03-30 11:53:58 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-30 16:13:57 +0100 |
commit | 00b9a1f97dbdfbdc1d268bf8d878937b150ce2d4 (patch) | |
tree | 5eee4014f0eec0a49a989dd016a578e80e213b23 /drivers/usb/chipidea/usbmisc_imx.c | |
parent | usb: chipidea: usbmisc: unset global varibale usbmisc on driver remove (diff) | |
download | linux-00b9a1f97dbdfbdc1d268bf8d878937b150ce2d4.tar.xz linux-00b9a1f97dbdfbdc1d268bf8d878937b150ce2d4.zip |
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 <mkl@pengutronix.de>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/usbmisc_imx.c')
-rw-r--r-- | drivers/usb/chipidea/usbmisc_imx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index fd4d3392125f..d77e712c6c2d 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c @@ -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; } |