Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: <lars@metafoo.de>, <linux-iio@vger.kernel.org>,
	<yangyingliang@huawei.com>, <guohanjun@huawei.com>,
	<jonathan.cameron@huawei.com>
Subject: Re: [PATCH] iio: adc: berlin2-adc: Add missing of_node_put() in error path
Date: Sun, 4 Dec 2022 14:27:40 +0000	[thread overview]
Message-ID: <20221204142740.56a46ef9@jic23-huawei> (raw)
In-Reply-To: <20221129020316.191731-1-wangxiongfeng2@huawei.com>

On Tue, 29 Nov 2022 10:03:16 +0800
Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote:

> of_get_parent() will return a device_node pointer with refcount
> incremented. We need to use of_node_put() on it when done. Add the
> missing of_node_put() in the error path of berlin2_adc_probe();
> 
> Fixes: 70f1937911ca ("iio: adc: add support for Berlin")
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Applied. 

Thanks,

Jonathan

> ---
>  drivers/iio/adc/berlin2-adc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/berlin2-adc.c b/drivers/iio/adc/berlin2-adc.c
> index 3d2e8b4db61a..a4e7c7eff5ac 100644
> --- a/drivers/iio/adc/berlin2-adc.c
> +++ b/drivers/iio/adc/berlin2-adc.c
> @@ -298,8 +298,10 @@ static int berlin2_adc_probe(struct platform_device *pdev)
>  	int ret;
>  
>  	indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv));
> -	if (!indio_dev)
> +	if (!indio_dev) {
> +		of_node_put(parent_np);
>  		return -ENOMEM;
> +	}
>  
>  	priv = iio_priv(indio_dev);
>  


      reply	other threads:[~2022-12-04 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  2:03 [PATCH] iio: adc: berlin2-adc: Add missing of_node_put() in error path Xiongfeng Wang
2022-12-04 14:27 ` 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=20221204142740.56a46ef9@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=guohanjun@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=wangxiongfeng2@huawei.com \
    --cc=yangyingliang@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