Skip to content

Commit

Permalink
memory: renesas-rpc-if: Fix a node reference leak in rpcif_probe()
Browse files Browse the repository at this point in the history
Release the node reference by calling of_node_put(flash) in the probe.

Fixes: ca7d8b9 ("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]>
  • Loading branch information
prabhakarlad authored and krzk committed Nov 28, 2020
1 parent 61a6d85 commit 4e6b86b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/memory/renesas-rpc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4e6b86b

Please sign in to comment.