* [PATCH 1/1] firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle
@ 2016-07-04 6:55 Peter Chen
0 siblings, 0 replies; only message in thread
From: Peter Chen @ 2016-07-04 6:55 UTC (permalink / raw)
To: linux-arm-kernel
of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.
Besides, of_address_to_resource always returns -EINVAL for error, delete
the assignment for ret.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
drivers/firmware/arm_scpi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index 7e3e595..fbf10d1 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -683,9 +683,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;
}
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-04 6:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-04 6:55 [PATCH 1/1] firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle Peter Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).