diff mbox

usb: ehci-s5p: fix: Fix null pointer dereferencing

Message ID 1365499312-14232-1-git-send-email-gautam.vivek@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vivek Gautam April 9, 2013, 9:21 a.m. UTC
7edb3da makes ehci-s5p as a separate driver. But,
it raised an issue with its 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>
---
 drivers/usb/host/ehci-s5p.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Arnd Bergmann April 9, 2013, 10:26 a.m. UTC | #1
On Tuesday 09 April 2013, Vivek Gautam wrote:
> 
> 7edb3da makes ehci-s5p as a separate driver. But,
> it raised an issue with its 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().

Right, sorry for not spotting this during review.

> 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>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov April 9, 2013, 12:31 p.m. UTC | #2
Hello.

On 09-04-2013 13:21, Vivek Gautam wrote:

> 7edb3da makes ehci-s5p as a separate driver. But,

    Please also provide the summary line of that commit in parens.

> it raised an issue with its 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>

WBR, Sergei


--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vivek Gautam April 9, 2013, 1:02 p.m. UTC | #3
Hi,


On Tue, Apr 9, 2013 at 6:01 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello.
>
>
> On 09-04-2013 13:21, Vivek Gautam wrote:
>
>> 7edb3da makes ehci-s5p as a separate driver. But,
>
>
>    Please also provide the summary line of that commit in parens.

Sure, will add the commit line of that patch.

>
>
>> it raised an issue with its 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>
>
>
> WBR, Sergei
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index d8cb0ca..580548a 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -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;