Skip to content

Commit

Permalink
usb: chipidea: usbmisc: fix a potential race condition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Kleine-Budde authored and Greg Kroah-Hartman committed Mar 30, 2013
1 parent d48a24d commit 00b9a1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/chipidea/usbmisc_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 00b9a1f

Please sign in to comment.