From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18637C4741F for ; Sat, 26 Sep 2020 14:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C981422B2D for ; Sat, 26 Sep 2020 14:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601131389; bh=DX633K5mKSo//7wFYke/29iydSK/7sr78KqgfCmnErE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=QEOEZ9ZlNDgs6olw3VHacNMGloPhQ/aTxKXdoll/SBVW8mCEYHPNYvLrmoCDcbh7X xkfgTflhAzAiZ5xdKbou2JFe7/lGNxN4Cm0mzc5aat9mvhuAssUHsfNmD4uiyrUXOS CkNZFP9JM2SxkhRmlb0cYR9AzRj6KwH8E1Mttq+8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726309AbgIZOnJ (ORCPT ); Sat, 26 Sep 2020 10:43:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:40186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725208AbgIZOnJ (ORCPT ); Sat, 26 Sep 2020 10:43:09 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5324720BED; Sat, 26 Sep 2020 14:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601131388; bh=DX633K5mKSo//7wFYke/29iydSK/7sr78KqgfCmnErE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0opKTnqE64+2e7/8fECEuA95OO6X6N62Au1tuQdwstCPr9WSTf4j0cD6RguPDlLQv mX1zOwK2HNrPmMuVB2scR8c2o8IjOzq0tmgU3uQxqwfFI9AnuEleu2LdQ+8HQDnrZf HzjhNkVsuTUZyJcPQSKAQOg0Srascd3r0AuVsJ94= Date: Sat, 26 Sep 2020 15:43:03 +0100 From: Jonathan Cameron To: Nuno =?UTF-8?B?U8Oh?= Cc: , Michael Hennerich , Marcelo Schmitt , Peter Meerwald-Stadler , Lars-Peter Clausen , Subject: Re: [PATCH 2/2] iio: ad7292: Fix of_node refcounting Message-ID: <20200926154303.5f51fba5@archlinux> In-Reply-To: <20200925091045.302-2-nuno.sa@analog.com> References: <20200925091045.302-1-nuno.sa@analog.com> <20200925091045.302-2-nuno.sa@analog.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Fri, 25 Sep 2020 11:10:45 +0200 Nuno S=C3=A1 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. >=20 > Fixes: 506d2e317a0a0 ("iio: adc: Add driver support for AD7292") > Cc: stable@vger.kernel.org > Signed-off-by: Nuno S=C3=A1 Applied to the fixes togreg branch of iio.git. Thanks Jonathan > --- > drivers/iio/adc/ad7292.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > 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) > =20 > for_each_available_child_of_node(spi->dev.of_node, child) { > diff_channels =3D of_property_read_bool(child, "diff-channels"); > - if (diff_channels) > + if (diff_channels) { > + of_node_put(child); > break; > + } > } > =20 > if (diff_channels) {