2020-11-27 08:42:25

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()

Release the node reference by calling of_node_put(flash) in the probe.

Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
Reported-by: Pavel Machek <[email protected]>
Signed-off-by: Lad Prabhakar <[email protected]>
Cc: [email protected]
Reviewed-by: Sergei Shtylyov <[email protected]>
---
drivers/memory/renesas-rpc-if.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index a8d0ba368625..da0fdb4c7595 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -561,9 +561,11 @@ static int rpcif_probe(struct platform_device *pdev)
} else if (of_device_is_compatible(flash, "cfi-flash")) {
name = "rpc-if-hyperflash";
} else {
+ of_node_put(flash);
dev_warn(&pdev->dev, "unknown flash type\n");
return -ENODEV;
}
+ of_node_put(flash);

vdev = platform_device_alloc(name, pdev->id);
if (!vdev)
--
2.25.1


2020-11-27 09:37:57

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()

On Thu, Nov 26, 2020 at 8:12 PM Lad Prabhakar
<[email protected]> wrote:
> Release the node reference by calling of_node_put(flash) in the probe.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <[email protected]>
> Signed-off-by: Lad Prabhakar <[email protected]>
> Cc: [email protected]
> Reviewed-by: Sergei Shtylyov <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

2020-11-27 22:56:15

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()

On Thu 2020-11-26 19:11:44, Lad Prabhakar wrote:
> Release the node reference by calling of_node_put(flash) in the probe.
>
> Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> Reported-by: Pavel Machek <[email protected]>
> Signed-off-by: Lad Prabhakar <[email protected]>
> Cc: [email protected]
> Reviewed-by: Sergei Shtylyov <[email protected]>

Reviewed-by: Pavel Machek (CIP)< <[email protected]>


--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


Attachments:
(No filename) (602.00 B)
signature.asc (201.00 B)
Download all attachments

2020-11-28 22:02:26

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()

On Fri, Nov 27, 2020 at 11:41:14PM +0100, Pavel Machek wrote:
> On Thu 2020-11-26 19:11:44, Lad Prabhakar wrote:
> > Release the node reference by calling of_node_put(flash) in the probe.
> >
> > Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
> > Reported-by: Pavel Machek <[email protected]>
> > Signed-off-by: Lad Prabhakar <[email protected]>
> > Cc: [email protected]
> > Reviewed-by: Sergei Shtylyov <[email protected]>
>
> Reviewed-by: Pavel Machek (CIP)< <[email protected]>

This breaks b4. Corrected and applied.

Best regards,
Krzysztof