From: Jonathan Cameron <jic23@kernel.org>
To: Wei Yongjun <weiyj.lk@gmail.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Giorgio Dal Molin <giorgio.nicole@arcor.de>,
Daniel Baluta <daniel.baluta@intel.com>,
Matt Ranostay <mranostay@gmail.com>,
Gregor Boirie <gregor.boirie@parrot.com>,
Crt Mori <cmo@melexis.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-iio@vger.kernel.org
Subject: Re: [PATCH -next] iio: adc: ti-ads1015: add missing of_node_put() in ads1015_get_channels_config_of()
Date: Mon, 29 Aug 2016 19:51:44 +0100 [thread overview]
Message-ID: <30d98e10-b65b-09ea-d625-a99eacd819ae@kernel.org> (raw)
In-Reply-To: <1472221910-661-1-git-send-email-weiyj.lk@gmail.com>
On 26/08/16 15:31, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> When terminating for_each_child_of_node() iteration with
> break or return, of_node_put() should be used to prevent
> stale device node references from being left behind.
>
> This is detected by Coccinelle semantic patch.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Thanks,
Applied to the togreg branch of iio.git. Initially pushed out
as testing for the autobuilders to play with it.
Jonathan
> ---
> drivers/iio/adc/ti-ads1015.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index 066abaf..cde6f13 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -522,6 +522,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
> if (pga > 6) {
> dev_err(&client->dev, "invalid gain on %s\n",
> node->full_name);
> + of_node_put(node);
> return -EINVAL;
> }
> }
> @@ -532,6 +533,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
> dev_err(&client->dev,
> "invalid data_rate on %s\n",
> node->full_name);
> + of_node_put(node);
> return -EINVAL;
> }
> }
>
>
>
prev parent reply other threads:[~2016-08-29 18:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 14:31 [PATCH -next] iio: adc: ti-ads1015: add missing of_node_put() in ads1015_get_channels_config_of() Wei Yongjun
2016-08-29 18:51 ` Jonathan Cameron [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=30d98e10-b65b-09ea-d625-a99eacd819ae@kernel.org \
--to=jic23@kernel.org \
--cc=cmo@melexis.com \
--cc=daniel.baluta@intel.com \
--cc=giorgio.nicole@arcor.de \
--cc=gregor.boirie@parrot.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=mranostay@gmail.com \
--cc=pmeerw@pmeerw.net \
--cc=weiyj.lk@gmail.com \
--cc=weiyongjun1@huawei.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).