usb: ehci-s5p: fix: Fix null pointer dereferencing
authorVivek Gautam <gautam.vivek@samsung.com>
Tue, 9 Apr 2013 13:12:11 +0000 (18:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2013 23:38:04 +0000 (16:38 -0700)
7edb3da: (USB: EHCI: make ehci-s5p a separate driver)
raised an issue with ehci-s5p's driver data.
Now that 's5p_ehci_hcd' doesn't maintain pointer to 'usb_hcd'
and s5p_ehci is nothing but a pointer to hcd->priv;
add hcd to the driver data rather than s5p_ehci.

This fixes issues with null pointer dereferencing in
s5p_ehci_shutdown(), s5p_ehci_suspend(), s5p_ehci_resume().

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
CC: Manjunath Goudar <manjunath.goudar@linaro.org>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Jingoo Han <jg1.han@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-s5p.c

index d8cb0ca563b589ae64bd3bda204ee82548a79e4a..580548ad8530594ece02098497b18c64a7a267a6 100644 (file)
@@ -173,7 +173,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
                goto fail_add_hcd;
        }
 
-       platform_set_drvdata(pdev, s5p_ehci);
+       platform_set_drvdata(pdev, hcd);
 
        return 0;