From: peter.chen@nxp.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/1] bus: arm-cci: add missing of_node_put after calling of_parse_phandle
Date: Mon, 4 Jul 2016 17:27:01 +0800 [thread overview]
Message-ID: <1467624421-2541-1-git-send-email-peter.chen@nxp.com> (raw)
of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.
Cc: arm at kernel.org
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
Changes for v2:
- Address suzuki's comments that calling of_node_put one time
for both error and corrent code path.
drivers/bus/arm-cci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index a49b283..648d130 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -1913,9 +1913,10 @@ static int __cci_ace_get_port(struct device_node *dn, int type)
for (i = 0; i < nb_cci_ports; i++) {
ace_match = ports[i].type == type;
if (ace_match && cci_portn == ports[i].dn)
- return i;
+ break;
}
- return -ENODEV;
+ of_node_put(cci_portn);
+ return (i < nb_cci_ports) ? i : -ENODEV;
}
int cci_ace_get_port(struct device_node *dn)
--
1.9.1
reply other threads:[~2016-07-04 9:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467624421-2541-1-git-send-email-peter.chen@nxp.com \
--to=peter.chen@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).