From: Mukesh Ojha <mojha@codeaurora.org>
To: Julia Lawall <Julia.Lawall@lip6.fr>, Mark Rutland <mark.rutland@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 12/12] drivers: firmware: psci: add missing of_node_put after of_device_is_available
Date: Mon, 1 Apr 2019 18:17:03 +0530 [thread overview]
Message-ID: <9b159e80-1ad2-0254-9543-852e1d7f04f9@codeaurora.org> (raw)
In-Reply-To: <1550928043-14889-13-git-send-email-Julia.Lawall@lip6.fr>
On 2/23/2019 6:50 PM, Julia Lawall wrote:
> Add an of_node_put when a tested device node is not available.
>
> The semantic patch that fixes this problem is as follows
> (http://Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
>
> Cheers,
> -Mukesh.lip6.fr):
>
> // <smpl>
> @@
> identifier f;
> local idexpression e;
> expression x;
> @@
>
> e = f(...);
> ... when != of_node_put(e)
> when != x = e
> when != e = x
> when any
> if (<+...of_device_is_available(e)...+>) {
> ... when != of_node_put(e)
> (
> return e;
> |
> + of_node_put(e);
> return ...;
> )
> }
> // </smpl>
>
> Fixes: d09a0011ec0d5 ("drivers: psci: Allow PSCI node to be disabled")
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
>
> ---
> drivers/firmware/psci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff -u -p a/drivers/firmware/psci.c b/drivers/firmware/psci.c
> --- a/drivers/firmware/psci.c
> +++ b/drivers/firmware/psci.c
> @@ -677,8 +677,10 @@ int __init psci_dt_init(void)
>
> np = of_find_matching_node_and_match(NULL, psci_of_match, &matched_np);
>
> - if (!np || !of_device_is_available(np))
> + if (!np || !of_device_is_available(np)) {
> + of_node_put(np);
> return -ENODEV;
> + }
>
> init_fn = (psci_initcall_t)matched_np->data;
> return init_fn(np);
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-04-01 12:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-23 13:20 [PATCH 00/12] add missing of_node_put after of_device_is_available Julia Lawall
2019-02-23 13:20 ` [PATCH 09/12] meson-gx-socinfo: " Julia Lawall
2019-03-12 20:28 ` Kevin Hilman
2019-04-14 16:12 ` Markus Elfring
2019-02-23 13:20 ` [PATCH 10/12] cpufreq: ap806: " Julia Lawall
2019-02-25 4:29 ` Viresh Kumar
2019-02-23 13:20 ` [PATCH 11/12] ARM: OMAP2+: " Julia Lawall
2019-03-22 22:24 ` Tony Lindgren
2019-04-14 16:38 ` [11/12] " Markus Elfring
2019-04-14 16:49 ` Julia Lawall
2019-02-23 13:20 ` [PATCH 12/12] drivers: firmware: psci: " Julia Lawall
2019-04-01 12:47 ` Mukesh Ojha [this message]
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=9b159e80-1ad2-0254-9543-852e1d7f04f9@codeaurora.org \
--to=mojha@codeaurora.org \
--cc=Julia.Lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
/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).