All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Wan Jiabing <wanjiabing@vivo.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Xu Wang <vulab@iscas.ac.cn>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>,
	linux-iio@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kael_w@yeah.net
Subject: Re: [PATCH v2] iio: adc: stm32-adc: Fix of_node_put() issue in stm32-adc
Date: Thu, 28 Oct 2021 15:26:31 +0100	[thread overview]
Message-ID: <20211028152631.0aa9c619@jic23-huawei> (raw)
In-Reply-To: <20211021121826.6339-1-wanjiabing@vivo.com>

On Thu, 21 Oct 2021 08:18:23 -0400
Wan Jiabing <wanjiabing@vivo.com> wrote:

> Fix following coccicheck warning:
> ./drivers/iio/adc/stm32-adc.c:2014:1-33: WARNING: Function
> for_each_available_child_of_node should have of_node_put() before return.
> 
> Early exits from for_each_available_child_of_node should decrement the
> node reference counter. Repalce return by goto here.

Replace


> 
> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>

We could treat this as a fix, but I'm feeling lazy and it's a minor that
should be harmless.  So applied to the togreg branch of iio.git and pushed
out as testing for 0-day to see if it can find anything we missed.

Thanks,

Jonathan


> ---
> Changelog:
> v2:
> - Fix typo and add reviewed-by.
> ---
>  drivers/iio/adc/stm32-adc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> index 6245434f8377..7f1fb36c747c 100644
> --- a/drivers/iio/adc/stm32-adc.c
> +++ b/drivers/iio/adc/stm32-adc.c
> @@ -2024,7 +2024,8 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev,
>  			if (strlen(name) >= STM32_ADC_CH_SZ) {
>  				dev_err(&indio_dev->dev, "Label %s exceeds %d characters\n",
>  					name, STM32_ADC_CH_SZ);
> -				return -EINVAL;
> +				ret = -EINVAL;
> +				goto err;
>  			}
>  			strncpy(adc->chan_name[val], name, STM32_ADC_CH_SZ);
>  			ret = stm32_adc_populate_int_ch(indio_dev, name, val);


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Wan Jiabing <wanjiabing@vivo.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Xu Wang <vulab@iscas.ac.cn>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>,
	linux-iio@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kael_w@yeah.net
Subject: Re: [PATCH v2] iio: adc: stm32-adc: Fix of_node_put() issue in stm32-adc
Date: Thu, 28 Oct 2021 15:26:31 +0100	[thread overview]
Message-ID: <20211028152631.0aa9c619@jic23-huawei> (raw)
In-Reply-To: <20211021121826.6339-1-wanjiabing@vivo.com>

On Thu, 21 Oct 2021 08:18:23 -0400
Wan Jiabing <wanjiabing@vivo.com> wrote:

> Fix following coccicheck warning:
> ./drivers/iio/adc/stm32-adc.c:2014:1-33: WARNING: Function
> for_each_available_child_of_node should have of_node_put() before return.
> 
> Early exits from for_each_available_child_of_node should decrement the
> node reference counter. Repalce return by goto here.

Replace


> 
> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>

We could treat this as a fix, but I'm feeling lazy and it's a minor that
should be harmless.  So applied to the togreg branch of iio.git and pushed
out as testing for 0-day to see if it can find anything we missed.

Thanks,

Jonathan


> ---
> Changelog:
> v2:
> - Fix typo and add reviewed-by.
> ---
>  drivers/iio/adc/stm32-adc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
> index 6245434f8377..7f1fb36c747c 100644
> --- a/drivers/iio/adc/stm32-adc.c
> +++ b/drivers/iio/adc/stm32-adc.c
> @@ -2024,7 +2024,8 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev,
>  			if (strlen(name) >= STM32_ADC_CH_SZ) {
>  				dev_err(&indio_dev->dev, "Label %s exceeds %d characters\n",
>  					name, STM32_ADC_CH_SZ);
> -				return -EINVAL;
> +				ret = -EINVAL;
> +				goto err;
>  			}
>  			strncpy(adc->chan_name[val], name, STM32_ADC_CH_SZ);
>  			ret = stm32_adc_populate_int_ch(indio_dev, name, val);


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-10-28 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 12:18 [PATCH v2] iio: adc: stm32-adc: Fix of_node_put() issue in stm32-adc Wan Jiabing
2021-10-21 12:18 ` Wan Jiabing
2021-10-28 14:26 ` Jonathan Cameron [this message]
2021-10-28 14:26   ` 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=20211028152631.0aa9c619@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=a.fatoum@pengutronix.de \
    --cc=alexandre.torgue@foss.st.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=kael_w@yeah.net \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=vulab@iscas.ac.cn \
    --cc=wanjiabing@vivo.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 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.