2013-04-09 09:23:49

by Vivek Gautam

[permalink] [raw]
Subject: [PATCH] usb: ehci-s5p: fix: Fix null pointer dereferencing

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 <[email protected]>
CC: Manjunath Goudar <[email protected]>
CC: Arnd Bergmann <[email protected]>
CC: Jingoo Han <[email protected]>
---
drivers/usb/host/ehci-s5p.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

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;

--
1.7.6.5


2013-04-09 10:27:20

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] usb: ehci-s5p: fix: Fix null pointer dereferencing

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 <[email protected]>
> CC: Manjunath Goudar <[email protected]>
> CC: Arnd Bergmann <[email protected]>
> CC: Jingoo Han <[email protected]>

Acked-by: Arnd Bergmann <[email protected]>

2013-04-09 12:32:22

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH] usb: ehci-s5p: fix: Fix null pointer dereferencing

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 <[email protected]>
> CC: Manjunath Goudar <[email protected]>
> CC: Arnd Bergmann <[email protected]>
> CC: Jingoo Han <[email protected]>

WBR, Sergei

2013-04-09 13:02:30

by Vivek Gautam

[permalink] [raw]
Subject: Re: [PATCH] usb: ehci-s5p: fix: Fix null pointer dereferencing

Hi,


On Tue, Apr 9, 2013 at 6:01 PM, Sergei Shtylyov
<[email protected]> 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 <[email protected]>
>> CC: Manjunath Goudar <[email protected]>
>> CC: Arnd Bergmann <[email protected]>
>> CC: Jingoo Han <[email protected]>
>
>
> WBR, Sergei



--
Thanks & Regards
Vivek

2013-04-09 13:14:53

by Vivek Gautam

[permalink] [raw]
Subject: [PATCH v2] usb: ehci-s5p: fix: Fix null pointer dereferencing

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 <[email protected]>
CC: Manjunath Goudar <[email protected]>
CC: Arnd Bergmann <[email protected]>
CC: Jingoo Han <[email protected]>
---

Based on 'usb-next'

drivers/usb/host/ehci-s5p.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

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;

--
1.7.6.5

2013-04-22 17:16:55

by Kukjin Kim

[permalink] [raw]
Subject: Re: [PATCH v2] usb: ehci-s5p: fix: Fix null pointer dereferencing

On 04/09/13 22:12, Vivek Gautam wrote:
> 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<[email protected]>
> CC: Manjunath Goudar<[email protected]>
> CC: Arnd Bergmann<[email protected]>
> CC: Jingoo Han<[email protected]>

Acked-by: Kukjin Kim <[email protected]>

Thanks.

- Kukjin

> ---
>
> Based on 'usb-next'
>
> drivers/usb/host/ehci-s5p.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> 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;
>