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]
Message-ID: <72bb447e-f888-6182-7328-316551b50a24@xs4all.nl>
Date:   Wed, 26 Aug 2020 10:56:14 +0200
From:   Hans Verkuil <hverkuil-cisco@...all.nl>
To:     Dinghao Liu <dinghao.liu@....edu.cn>, kjlu@....edu
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Fabio Estevam <fabio.estevam@....com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: mx2_emmaprp: Fix memleak in emmaprp_probe

On 25/08/2020 11:39, Dinghao Liu wrote:
> When platform_get_irq() fails, we should release
> vfd and unregister pcdev->v4l2_dev just like the
> subsequent error paths.
> 
> Fixes: d4e192cc44914 ("media: mx2_emmaprp: Check for platform_get_irq() error")
> Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> ---
>  drivers/media/platform/mx2_emmaprp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
> index df78df59da45..2fd31ed86005 100644
> --- a/drivers/media/platform/mx2_emmaprp.c
> +++ b/drivers/media/platform/mx2_emmaprp.c
> @@ -853,7 +853,7 @@ static int emmaprp_probe(struct platform_device *pdev)
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
> -		return irq;
> +		goto rel_vdev;

You need to add 'ret = irq;' here, otherwise the platform_get_irq error code
is not correctly propagated.

Looks good otherwise.

Regards,

	Hans

>  	ret = devm_request_irq(&pdev->dev, irq, emmaprp_irq, 0,
>  			       dev_name(&pdev->dev), pcdev);
>  	if (ret)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ