From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
nfont@linux.vnet.ibm.com, jallen@linux.vnet.ibm.com
Cc: kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/pseries: Fix missing of_node_put
Date: Mon, 6 Feb 2017 15:05:42 -0800 [thread overview]
Message-ID: <ec50fa3a-1012-805f-2541-1519ef1c0327@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170206213616.3661-1-christophe.jaillet@wanadoo.fr>
On 02/06/2017 01:36 PM, Christophe JAILLET wrote:
> If 'dlpar_configure_connector()' fails, 'parent_dn' should be released as
> already done in the normal case.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> arch/powerpc/platforms/pseries/mobility.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index 5a0c7ba429ce..b8060c182ae2 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -226,13 +226,16 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
> return -ENOENT;
>
> dn = dlpar_configure_connector(drc_index, parent_dn);
Simpler approach would be to move the of_node_put() call to here
directly after the last use of parent_dn.
-Tyrel
> - if (!dn)
> - return -ENOENT;
> + if (!dn) {
> + rc = -ENOENT;
> + goto out;
> + }
>
> rc = dlpar_attach_node(dn);
> if (rc)
> dlpar_free_cc_nodes(dn);
>
> +out:
> of_node_put(parent_dn);
> return rc;
> }
>
prev parent reply other threads:[~2017-02-06 23:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-06 21:36 Christophe JAILLET
2017-02-06 23:05 ` Tyrel Datwyler [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=ec50fa3a-1012-805f-2541-1519ef1c0327@linux.vnet.ibm.com \
--to=tyreld@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=jallen@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nfont@linux.vnet.ibm.com \
--cc=paulus@samba.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
all inboxes | Powered by JetHome®