diff options
author | Lad Prabhakar <[email protected]> | 2020-11-26 19:11:44 +0000 |
---|---|---|
committer | Krzysztof Kozlowski <[email protected]> | 2020-11-28 12:34:57 +0100 |
commit | 4e6b86b409f9fc63fedb39d6e3a0202c4b0244ce (patch) | |
tree | c1f0aaea544be57825b349e3f7dead2f3c4fda92 | |
parent | 61a6d854b9555b420fbfae62ef26baa8b9493b32 (diff) |
memory: renesas-rpc-if: Fix a node 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]>
Reviewed-by: Sergei Shtylyov <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Pavel Machek (CIP) <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
-rw-r--r-- | drivers/memory/renesas-rpc-if.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) |