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:   Mon, 7 Mar 2022 08:35:31 +0100
From:   Hans Verkuil <hverkuil@...all.nl>
To:     Miaoqian Lin <linmq006@...il.com>,
        Hugues Fruchet <hugues.fruchet@...s.st.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Peter Griffin <peter.griffin@...aro.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] media: st-delta: Fix PM disable depth imbalance in
 delta_probe

Hi Miaoqian Lin,

On 3/1/22 04:12, Miaoqian Lin wrote:
> The pm_runtime_enable will increase power disable depth.
> If the probe fails, we should use pm_runtime_disable() to balance
> pm_runtime_enable().
> 
> Fixes: f386509 ("[media] st-delta: STiH4xx multi-format video decoder v4l2 driver")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
> changes in v2:
> - remove unused label.
> ---
>  drivers/media/platform/sti/delta/delta-v4l2.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/sti/delta/delta-v4l2.c b/drivers/media/platform/sti/delta/delta-v4l2.c
> index c887a31ebb54..36ce0775f3f9 100644
> --- a/drivers/media/platform/sti/delta/delta-v4l2.c
> +++ b/drivers/media/platform/sti/delta/delta-v4l2.c
> @@ -1899,6 +1899,7 @@ static int delta_probe(struct platform_device *pdev)
>  err_v4l2:
>  	v4l2_device_unregister(&delta->v4l2_dev);
>  err:
> +	pm_runtime_disable(dev);

This isn't right. If the devm_kzalloc at the beginning fails, then it also jump
to this label, but at that time no pm_runtime_enable() has been called yet,
so this patch will just introduce another imbalance.

You *do* need a new label here (like you did in v1 of this patch), and update
the 'goto err;' instances after the call to pm_runtime_enable() to go to that
new label.

Regards,

	Hans

>  	return ret;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ