lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Jan 2022 11:06:32 +0100
From:   Hans Verkuil <hverkuil@...all.nl>
To:     Miaoqian Lin <linmq006@...il.com>
Cc:     Philipp Zabel <p.zabel@...gutronix.de>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Michael Tretter <m.tretter@...gutronix.de>,
        Hans Verkuil <hans.verkuil@...co.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: coda: Fix missing put_device() call in
 coda_get_vdoa_data

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@...il.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);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ