public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: usb5303: make use of uninitialized err variable
@ 2014-06-02 17:45 Emil Goode
  2014-06-11 19:02 ` Geert Uytterhoeven
  2014-07-09 22:46 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 5+ messages in thread
From: Emil Goode @ 2014-06-02 17:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Mark Brown, Olof Johansson, Dongjin Kim,
	Julius Werner, Marek Szyprowski
  Cc: linux-usb, linux-kernel, kernel-janitors, Emil Goode

The variable err is not initialized here, this patch uses it
to store an eventual error value from devm_clk_get().

Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
 drivers/usb/misc/usb3503.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index f43c619..c86c3fa 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -191,9 +191,13 @@ static int usb3503_probe(struct usb3503 *hub)
 		hub->port_off_mask = 0;
 
 		clk = devm_clk_get(dev, "refclk");
-		if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
-			dev_err(dev, "unable to request refclk (%d)\n", err);
-			return PTR_ERR(clk);
+		if (IS_ERR(clk)) {
+			err = PTR_ERR(clk);
+			if (err != -ENOENT) {
+				dev_err(dev, "unable to request refclk (%d)\n",
+					err);
+				return err;
+			}
 		}
 
 		if (!IS_ERR(clk)) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: usb5303: make use of uninitialized err variable
  2014-06-02 17:45 [PATCH] usb: usb5303: make use of uninitialized err variable Emil Goode
@ 2014-06-11 19:02 ` Geert Uytterhoeven
  2014-07-09 22:46 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-06-11 19:02 UTC (permalink / raw)
  To: Emil Goode
  Cc: Greg Kroah-Hartman, Mark Brown, Olof Johansson, Dongjin Kim,
	Julius Werner, Marek Szyprowski, USB list,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org

On Mon, Jun 2, 2014 at 7:45 PM, Emil Goode <emilgoode@gmail.com> wrote:
> The variable err is not initialized here, this patch uses it
> to store an eventual error value from devm_clk_get().
>
> Signed-off-by: Emil Goode <emilgoode@gmail.com>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: usb5303: make use of uninitialized err variable
  2014-06-02 17:45 [PATCH] usb: usb5303: make use of uninitialized err variable Emil Goode
  2014-06-11 19:02 ` Geert Uytterhoeven
@ 2014-07-09 22:46 ` Greg Kroah-Hartman
  2014-07-10  7:38   ` Geert Uytterhoeven
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2014-07-09 22:46 UTC (permalink / raw)
  To: Emil Goode
  Cc: Mark Brown, Olof Johansson, Dongjin Kim, Julius Werner,
	Marek Szyprowski, linux-usb, linux-kernel, kernel-janitors

On Mon, Jun 02, 2014 at 07:45:25PM +0200, Emil Goode wrote:
> The variable err is not initialized here, this patch uses it
> to store an eventual error value from devm_clk_get().
> 
> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  drivers/usb/misc/usb3503.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
> index f43c619..c86c3fa 100644
> --- a/drivers/usb/misc/usb3503.c
> +++ b/drivers/usb/misc/usb3503.c
> @@ -191,9 +191,13 @@ static int usb3503_probe(struct usb3503 *hub)
>  		hub->port_off_mask = 0;
>  
>  		clk = devm_clk_get(dev, "refclk");
> -		if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
> -			dev_err(dev, "unable to request refclk (%d)\n", err);
> -			return PTR_ERR(clk);
> +		if (IS_ERR(clk)) {
> +			err = PTR_ERR(clk);
> +			if (err != -ENOENT) {
> +				dev_err(dev, "unable to request refclk (%d)\n",
> +					err);
> +				return err;
> +			}
>  		}
>  
>  		if (!IS_ERR(clk)) {
> -- 
> 1.7.10.4

This patch fails to apply to my tree :(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: usb5303: make use of uninitialized err variable
  2014-07-09 22:46 ` Greg Kroah-Hartman
@ 2014-07-10  7:38   ` Geert Uytterhoeven
  2014-07-10 11:12     ` Emil Goode
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2014-07-10  7:38 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Emil Goode, Mark Brown, Olof Johansson, Dongjin Kim,
	Julius Werner, Marek Szyprowski, USB list,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org

Hi Greg,

On Thu, Jul 10, 2014 at 12:46 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Mon, Jun 02, 2014 at 07:45:25PM +0200, Emil Goode wrote:
>> The variable err is not initialized here, this patch uses it
>> to store an eventual error value from devm_clk_get().
>>
>> Signed-off-by: Emil Goode <emilgoode@gmail.com>
>> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>>  drivers/usb/misc/usb3503.c |   10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)

> This patch fails to apply to my tree :(

You've already applied
commit ec5734c41bee2ee7c938a8f34853d31cada7e67a
Author: Tushar Behera <tushar.b@samsung.com>
Date:   Tue Jun 17 16:38:50 2014 +0530

    usb: misc: usb3503: Update error code in print message

    'err' is uninitialized, rather print the error code directly.

which fixes it slightly different.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: usb5303: make use of uninitialized err variable
  2014-07-10  7:38   ` Geert Uytterhoeven
@ 2014-07-10 11:12     ` Emil Goode
  0 siblings, 0 replies; 5+ messages in thread
From: Emil Goode @ 2014-07-10 11:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Mark Brown, Olof Johansson, Dongjin Kim,
	Julius Werner, Marek Szyprowski, USB list,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org

Hello Greg and Geert,

On Thu, Jul 10, 2014 at 09:38:00AM +0200, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> On Thu, Jul 10, 2014 at 12:46 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Mon, Jun 02, 2014 at 07:45:25PM +0200, Emil Goode wrote:
> >> The variable err is not initialized here, this patch uses it
> >> to store an eventual error value from devm_clk_get().
> >>
> >> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> >> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >> ---
> >>  drivers/usb/misc/usb3503.c |   10 +++++++---
> >>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> > This patch fails to apply to my tree :(
> 
> You've already applied
> commit ec5734c41bee2ee7c938a8f34853d31cada7e67a
> Author: Tushar Behera <tushar.b@samsung.com>
> Date:   Tue Jun 17 16:38:50 2014 +0530
> 
>     usb: misc: usb3503: Update error code in print message
> 
>     'err' is uninitialized, rather print the error code directly.
> 
> which fixes it slightly different.

Yes, my patch was sent about two weeks earlier, but of course please pick
the one you think is best.

Best regards,

Emil Goode

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-10 11:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-02 17:45 [PATCH] usb: usb5303: make use of uninitialized err variable Emil Goode
2014-06-11 19:02 ` Geert Uytterhoeven
2014-07-09 22:46 ` Greg Kroah-Hartman
2014-07-10  7:38   ` Geert Uytterhoeven
2014-07-10 11:12     ` Emil Goode

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox