Skip to content

Commit

Permalink
usb: ehci-mxc: check for pdata before dereferencing
Browse files Browse the repository at this point in the history
Commit 7e8d5cd ("USB: Add EHCI support for MX27 and MX31 based
boards") introduced code that could potentially lead to a NULL pointer
dereference on driver removal.

Fix this by checking for the value of pdata before dereferencing it.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org> # 2.6.33+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Daniel Mack authored and Greg Kroah-Hartman committed Aug 23, 2013
1 parent 67e51ec commit f375fc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static int ehci_mxc_drv_remove(struct platform_device *pdev)
if (pdata && pdata->exit)
pdata->exit(pdev);

if (pdata->otg)
if (pdata && pdata->otg)
usb_phy_shutdown(pdata->otg);

clk_disable_unprepare(priv->usbclk);
Expand Down

0 comments on commit f375fc5

Please sign in to comment.