summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2016-07-04 08:55:57 +0200
committerSudeep Holla <sudeep.holla@arm.com>2016-08-08 15:31:09 +0200
commitb079bd555f6060cd6b435a1eb58ec3b8d255ebd0 (patch)
tree53f5ebe25f2647ea20b84a271f133117f45580e5 /drivers/firmware
parentbus: vexpress-config: add missing of_node_put after calling of_parse_phandle (diff)
downloadlinux-b079bd555f6060cd6b435a1eb58ec3b8d255ebd0.tar.xz
linux-b079bd555f6060cd6b435a1eb58ec3b8d255ebd0.zip
firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using it. Besides, of_address_to_resource always returns -EINVAL for error, delete the assignment for ret. Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/arm_scpi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index 438893762076..ce2bc2a38101 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -709,9 +709,10 @@ static int scpi_probe(struct platform_device *pdev)
struct mbox_client *cl = &pchan->cl;
struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
- if (of_address_to_resource(shmem, 0, &res)) {
+ ret = of_address_to_resource(shmem, 0, &res);
+ of_node_put(shmem);
+ if (ret) {
dev_err(dev, "failed to get SCPI payload mem resource\n");
- ret = -EINVAL;
goto err;
}