From: Scott Wood <oss@buserror.net>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
galak@kernel.crashing.org, benh@kernel.crashing.org,
paulus@samba.org, mpe@ellerman.id.au
Cc: kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] powerpc/83xx: Add some error handling in 'quirk_mpc8360e_qe_enet10()'
Date: Sat, 29 Feb 2020 17:17:39 -0600 [thread overview]
Message-ID: <4b8581f5fd497b3fb1e5232510cd57c1e7ccb92d.camel@buserror.net> (raw)
In-Reply-To: <20200208140920.7652-1-christophe.jaillet@wanadoo.fr>
On Sat, 2020-02-08 at 15:09 +0100, Christophe JAILLET wrote:
> In some error handling path, we should call "of_node_put(np_par)" or
> some resource may be leaking in case of error.
>
> Fixes: 8159df72d43e ("83xx: add support for the kmeter1 board.")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> arch/powerpc/platforms/83xx/km83xx.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Both patches:
Acked-by: Scott Wood <oss@buserror.net>
> diff --git a/arch/powerpc/platforms/83xx/km83xx.c
> b/arch/powerpc/platforms/83xx/km83xx.c
> index 306be75faec7..bcdc2c203ec9 100644
> --- a/arch/powerpc/platforms/83xx/km83xx.c
> +++ b/arch/powerpc/platforms/83xx/km83xx.c
> @@ -60,10 +60,12 @@ static void quirk_mpc8360e_qe_enet10(void)
> ret = of_address_to_resource(np_par, 0, &res);
> if (ret) {
> pr_warn("%s couldn't map par_io registers\n", __func__);
> - return;
> + goto out;
> }
>
> base = ioremap(res.start, resource_size(&res));
> + if (!base)
> + goto out;
>
> /*
> * set output delay adjustments to default values according
> @@ -111,6 +113,7 @@ static void quirk_mpc8360e_qe_enet10(void)
> setbits32((base + 0xac), 0x0000c000);
> }
> iounmap(base);
> +out:
> of_node_put(np_par);
> }
>
prev parent reply other threads:[~2020-02-29 23:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-08 14:09 [PATCH 2/2] powerpc/83xx: Add some error handling in 'quirk_mpc8360e_qe_enet10()' Christophe JAILLET
2020-02-29 23:17 ` Scott Wood [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=4b8581f5fd497b3fb1e5232510cd57c1e7ccb92d.camel@buserror.net \
--to=oss@buserror.net \
--cc=benh@kernel.crashing.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=galak@kernel.crashing.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--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;
as well as URLs for NNTP newsgroup(s).