All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: <linux-iio@vger.kernel.org>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Lars-Peter Clausen <lars@metafoo.de>, <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] iio: ad7292: Fix of_node refcounting
Date: Sat, 26 Sep 2020 15:43:03 +0100	[thread overview]
Message-ID: <20200926154303.5f51fba5@archlinux> (raw)
In-Reply-To: <20200925091045.302-2-nuno.sa@analog.com>

On Fri, 25 Sep 2020 11:10:45 +0200
Nuno Sá <nuno.sa@analog.com> wrote:

> When returning or breaking early from a
> `for_each_available_child_of_node()` loop, we need to explicitly call
> `of_node_put()` on the child node to possibly release the node.
> 
> Fixes: 506d2e317a0a0 ("iio: adc: Add driver support for AD7292")
> Cc: stable@vger.kernel.org
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Applied to the fixes togreg branch of iio.git.

Thanks

Jonathan

> ---
>  drivers/iio/adc/ad7292.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7292.c b/drivers/iio/adc/ad7292.c
> index 2eafbe7ac7c7..ab204e9199e9 100644
> --- a/drivers/iio/adc/ad7292.c
> +++ b/drivers/iio/adc/ad7292.c
> @@ -310,8 +310,10 @@ static int ad7292_probe(struct spi_device *spi)
>  
>  	for_each_available_child_of_node(spi->dev.of_node, child) {
>  		diff_channels = of_property_read_bool(child, "diff-channels");
> -		if (diff_channels)
> +		if (diff_channels) {
> +			of_node_put(child);
>  			break;
> +		}
>  	}
>  
>  	if (diff_channels) {


  reply	other threads:[~2020-09-26 14:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  9:10 [PATCH 1/2] iio: ltc2983: Fix of_node refcounting Nuno Sá
2020-09-25  9:10 ` [PATCH 2/2] iio: ad7292: " Nuno Sá
2020-09-26 14:43   ` Jonathan Cameron [this message]
2020-09-26 14:32 ` [PATCH 1/2] iio: ltc2983: " Jonathan Cameron

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=20200926154303.5f51fba5@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=pmeerw@pmeerw.net \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.