All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Michael Tretter <m.tretter@pengutronix.de>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: coda: Fix missing put_device() call in coda_get_vdoa_data
Date: Tue, 11 Jan 2022 11:06:32 +0100	[thread overview]
Message-ID: <5454a150-7b11-dbce-02c4-d300c6629b1e@xs4all.nl> (raw)
In-Reply-To: <20220107081829.15108-1-linmq006@gmail.com>

On 07/01/2022 09:18, Miaoqian Lin wrote:
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore.
> Add the corresponding 'put_device()' in the error handling path.
> 
> Fixes: e7f3c5481035 ("[media] coda: use VDOA for un-tiling custom macroblock format")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/media/platform/coda/coda-common.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
> index 0e312b0842d7..579849082488 100644
> --- a/drivers/media/platform/coda/coda-common.c
> +++ b/drivers/media/platform/coda/coda-common.c
> @@ -405,9 +405,13 @@ static struct vdoa_data *coda_get_vdoa_data(void)
>  		goto out;
>  
>  	vdoa_data = platform_get_drvdata(vdoa_pdev);
> -	if (!vdoa_data)
> +	if (!vdoa_data) {
>  		vdoa_data = ERR_PTR(-EPROBE_DEFER);
> +		goto put;

Why the goto put? Just drop the goto...

> +	}
>  
> +put:

...and this label.

> +	put_device(&vdoa_pdev->dev);

This is the real fix :-)

Regards,

	Hans

>  out:
>  	of_node_put(vdoa_node);
>  


  reply	other threads:[~2022-01-11 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  8:18 [PATCH] media: coda: Fix missing put_device() call in coda_get_vdoa_data Miaoqian Lin
2022-01-11 10:06 ` Hans Verkuil [this message]
2022-01-12 11:05   ` [PATCH v2] " Miaoqian Lin

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=5454a150-7b11-dbce-02c4-d300c6629b1e@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=hans.verkuil@cisco.com \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.tretter@pengutronix.de \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    /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.