All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>,
	quic_vgarodia@quicinc.com, stanimir.k.varbanov@gmail.com
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	bryan.odonoghue@linaro.org
Subject: Re: [PATCH] media: venus: Fix probe error handling
Date: Fri, 28 Mar 2025 16:05:14 +0000	[thread overview]
Message-ID: <47a2cfb1-314d-407d-a7ca-2d616b4c6d0a@kernel.org> (raw)
In-Reply-To: <20250327125304.1090805-1-loic.poulain@oss.qualcomm.com>

On 27/03/2025 12:53, Loic Poulain wrote:
> Video device registering has been moved earlier in the probe function,
> but the new order has not been propagated to error handling. This means
> we can end with unreleased resources on error (e.g dangling video device
> on missing firmware probe aborting).
> 
> Fixes: 08b1cf474b7f7 ("media: venus: core, venc, vdec: Fix probe dependency error")
> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
>   drivers/media/platform/qcom/venus/core.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index c4438e4b2d9b..103afda799ed 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -438,7 +438,7 @@ static int venus_probe(struct platform_device *pdev)
> 
>   	ret = v4l2_device_register(dev, &core->v4l2_dev);
>   	if (ret)
> -		goto err_core_deinit;
> +		goto err_hfi_destroy;
> 
>   	platform_set_drvdata(pdev, core);
> 
> @@ -476,24 +476,24 @@ static int venus_probe(struct platform_device *pdev)
> 
>   	ret = venus_enumerate_codecs(core, VIDC_SESSION_TYPE_DEC);
>   	if (ret)
> -		goto err_venus_shutdown;
> +		goto err_core_deinit;
> 
>   	ret = venus_enumerate_codecs(core, VIDC_SESSION_TYPE_ENC);
>   	if (ret)
> -		goto err_venus_shutdown;
> +		goto err_core_deinit;
> 
>   	ret = pm_runtime_put_sync(dev);
>   	if (ret) {
>   		pm_runtime_get_noresume(dev);
> -		goto err_dev_unregister;
> +		goto err_core_deinit;
>   	}
> 
>   	venus_dbgfs_init(core);
> 
>   	return 0;
> 
> -err_dev_unregister:
> -	v4l2_device_unregister(&core->v4l2_dev);
> +err_core_deinit:
> +	hfi_core_deinit(core, false);
>   err_venus_shutdown:
>   	venus_shutdown(core);
>   err_firmware_deinit:
> @@ -506,9 +506,9 @@ static int venus_probe(struct platform_device *pdev)
>   	pm_runtime_put_noidle(dev);
>   	pm_runtime_disable(dev);
>   	pm_runtime_set_suspended(dev);
> +	v4l2_device_unregister(&core->v4l2_dev);
> +err_hfi_destroy:
>   	hfi_destroy(core);
> -err_core_deinit:
> -	hfi_core_deinit(core, false);
>   err_core_put:
>   	if (core->pm_ops->core_put)
>   		core->pm_ops->core_put(core);
> --
> 2.34.1
> 
> 
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>

  parent reply	other threads:[~2025-03-28 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <riuofNmnHEZYFpNAkKYNZAEin3vihrkFlhukRCsZ_HfO7ZpmXiKVG9N-ICxJKdufFrlmf-DhDoUdjI2EBANAKA==@protonmail.internalid>
2025-03-27 12:53 ` [PATCH] media: venus: Fix probe error handling Loic Poulain
2025-03-28 16:04   ` Bryan O'Donoghue
2025-03-28 16:05   ` Bryan O'Donoghue [this message]
2025-04-02  8:57   ` Dikshita Agarwal

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=47a2cfb1-314d-407d-a7ca-2d616b4c6d0a@kernel.org \
    --to=bod@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=stanimir.k.varbanov@gmail.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 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.