From: Ulf Hansson <ulf.hansson@linaro.org>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>,
Tony Lindgren <tony@atomide.com>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Janusz Krzysztofik <jmkrzyszt@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mark Brown <broonie@kernel.org>,
NXP Linux Team <linux-imx@nxp.com>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: ux500: add missing of_node_put()
Date: Mon, 15 Apr 2019 11:52:20 +0200 [thread overview]
Message-ID: <CAPDyKFrdCPJRWEa37fWLMxJHzoSB_W-WrDahfz3AF=SvfCU4GA@mail.gmail.com> (raw)
In-Reply-To: <1555139666-948-10-git-send-email-hofrat@osadl.org>
On Sat, 13 Apr 2019 at 09:20, Nicholas Mc Guire <hofrat@osadl.org> wrote:
>
> of_find_compatible_node() returns a pointer with refcount incremented
> so both in the error path as well as after usage in soc_info_populate()
> respectively actually b8500_read_soc_id() an explicit of_node_put is
> needed to release backupram.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> Fixes: commit 18a992787896 ("ARM: ux500: move soc_id driver to drivers/soc")
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>
> Problem located with experimental cocinelle script
>
> get_maintainer.pl only returns linux-kernel@vger.kernel.org for
> this file ? Is MAINTAINERS entry missing ?
drivers/soc/ux500 should be added to the ARM/NOMADIK/U300/Ux500
ARCHITECTURES section, which is maintained by Linus Walleij.
If you send a patch, I am sure Linus will ack it.
>
> Not really sure about the referenced fixes commit 18a992787896
> ("ARM: ux500: move soc_id driver to drivers/soc") the commit log notes
> only that the driver is being moved and not expected to change (v4.8)
> but looking at the previous version in v4.7 it does seem that while
> moving the driver there was also a relevant change to the driver code
> including the switch to using of_find_compatible_node().
>
> Patch was compiletested with: u8500_defconfig (implies
> ONFIG_UX500_SOC_ID=y)
>
> Patch is against 4.18-rc3 (localversion-next is next-20180706)
>
> drivers/soc/ux500/ux500-soc-id.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c
> index 6c1be74..e22597d 100644
> --- a/drivers/soc/ux500/ux500-soc-id.c
> +++ b/drivers/soc/ux500/ux500-soc-id.c
> @@ -203,10 +203,13 @@ static int __init ux500_soc_device_init(void)
> ux500_setup_id();
>
> soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
> - if (!soc_dev_attr)
> + if (!soc_dev_attr) {
> + of_node_put(backupram);
> return -ENOMEM;
> + }
>
> soc_info_populate(soc_dev_attr, backupram);
> + of_node_put(backupram);
>
> soc_dev = soc_device_register(soc_dev_attr);
> if (IS_ERR(soc_dev)) {
> --
> 2.1.4
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-04-15 9:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-13 7:14 [PATCH 0/4] ARM: imx legacy: cleanups Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 0/3] ARM: hisi: fix of_iomap errors Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH] ARM: add missing of_node_put() Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 1/3] ARM: hisi: fix error handling and missing of_node_put Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH] ARM: imx: flag failure of of_iomap Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH] ARM: STi: at least warn if of_iomap fails Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH V2] ARM: STi: warn if scu mapping fails Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH] ARM: u300: add missing check for kmalloc Nicholas Mc Guire
2019-04-23 10:26 ` Linus Walleij
2019-04-13 7:14 ` [PATCH] ARM: ux500: add missing of_node_put() Nicholas Mc Guire
2019-04-15 9:52 ` Ulf Hansson [this message]
2019-04-16 11:49 ` Linus Walleij
2019-04-13 7:14 ` [PATCH 2/3] ARM: hisi: check of_iomap and fix missing of_node_put Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 3/3] ARM: hisi: handle of_iomap and fix missing of_node_put Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in () Nicholas Mc Guire
2019-04-13 7:14 ` [PATCH 4/4] ARM: imx legacy: add an SPDX license identifier Nicholas Mc Guire
2019-04-13 7:58 ` [PATCH 0/4] ARM: imx legacy: cleanups Joe Perches
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='CAPDyKFrdCPJRWEa37fWLMxJHzoSB_W-WrDahfz3AF=SvfCU4GA@mail.gmail.com' \
--to=ulf.hansson@linaro.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=hofrat@osadl.org \
--cc=jmkrzyszt@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=rppt@linux.vnet.ibm.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=tony@atomide.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).