Commit 4e6b86b4 authored by Lad Prabhakar's avatar Lad Prabhakar Committed by Krzysztof Kozlowski

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: ca7d8b98 ("memory: add Renesas RPC-IF driver")
Reported-by: default avatarPavel Machek <pavel@denx.de>
Signed-off-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@gmail.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarPavel Machek (CIP) <pavel@denx.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20201126191146.8753-4-prabhakar.mahadev-lad.rj@bp.renesas.comSigned-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 61a6d854
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment