linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
@ 2024-01-05  9:37 Yoshihiro Shimoda
  2024-01-05 10:25 ` Geert Uytterhoeven
  2024-01-24  5:59 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Yoshihiro Shimoda @ 2024-01-05  9:37 UTC (permalink / raw)
  To: vkoul, kishon
  Cc: error27, linux-phy, linux-renesas-soc, Yoshihiro Shimoda,
	kernel test robot

Even if device_create_file() returns error code,
rcar_gen3_phy_usb2_probe() will return zero because the "ret" is
variable shadowing.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202312161021.gOLDl48K-lkp@intel.com/
Fixes: 441a681b8843 ("phy: rcar-gen3-usb2: fix implementation for runtime PM")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/phy/renesas/phy-rcar-gen3-usb2.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index e53eace7c91e..6387c0d34c55 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -673,8 +673,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
 	channel->irq = platform_get_irq_optional(pdev, 0);
 	channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node);
 	if (channel->dr_mode != USB_DR_MODE_UNKNOWN) {
-		int ret;
-
 		channel->is_otg_channel = true;
 		channel->uses_otg_pins = !of_property_read_bool(dev->of_node,
 							"renesas,no-otg-pins");
@@ -738,8 +736,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
 		ret = PTR_ERR(provider);
 		goto error;
 	} else if (channel->is_otg_channel) {
-		int ret;
-
 		ret = device_create_file(dev, &dev_attr_role);
 		if (ret < 0)
 			goto error;
-- 
2.25.1


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

* Re: [PATCH] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
  2024-01-05  9:37 [PATCH] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code Yoshihiro Shimoda
@ 2024-01-05 10:25 ` Geert Uytterhoeven
  2024-01-24  5:59 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2024-01-05 10:25 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: vkoul, kishon, error27, linux-phy, linux-renesas-soc, kernel test robot

On Fri, Jan 5, 2024 at 10:42 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> Even if device_create_file() returns error code,
> rcar_gen3_phy_usb2_probe() will return zero because the "ret" is
> variable shadowing.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202312161021.gOLDl48K-lkp@intel.com/
> Fixes: 441a681b8843 ("phy: rcar-gen3-usb2: fix implementation for runtime PM")
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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] 3+ messages in thread

* Re: [PATCH] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
  2024-01-05  9:37 [PATCH] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code Yoshihiro Shimoda
  2024-01-05 10:25 ` Geert Uytterhoeven
@ 2024-01-24  5:59 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2024-01-24  5:59 UTC (permalink / raw)
  To: kishon, Yoshihiro Shimoda
  Cc: error27, linux-phy, linux-renesas-soc, kernel test robot


On Fri, 05 Jan 2024 18:37:03 +0900, Yoshihiro Shimoda wrote:
> Even if device_create_file() returns error code,
> rcar_gen3_phy_usb2_probe() will return zero because the "ret" is
> variable shadowing.
> 
> 

Applied, thanks!

[1/1] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
      commit: 249abaf3bf0dd07f5ddebbb2fe2e8f4d675f074e

Best regards,
-- 
~Vinod



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

end of thread, other threads:[~2024-01-24  5:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-05  9:37 [PATCH] phy: renesas: rcar-gen3-usb2: Fix returning wrong error code Yoshihiro Shimoda
2024-01-05 10:25 ` Geert Uytterhoeven
2024-01-24  5:59 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).