mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: stanimir.varbanov@linaro.org, agross@kernel.org,
	bjorn.andersson@linaro.org, mchehab@kernel.org,
	hverkuil-cisco@xs4all.nl, acourbot@chromium.org
Cc: linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: venus: core: Fix a resource leak in the error handling path of 'venus_probe()'
Date: Thu, 11 Nov 2021 16:17:16 +0100	[thread overview]
Message-ID: <b7b1dbd7-9578-d34f-e8a3-0ce045485de0@wanadoo.fr> (raw)
In-Reply-To: <ea6bddd4da925fcd3016cdb3fc8d40d2311c55a4.1629403336.git.christophe.jaillet@wanadoo.fr>

Le 19/08/2021 à 22:05, Christophe JAILLET a écrit :
> A successful 'of_platform_populate()' call should be balanced by a
> corresponding 'of_platform_depopulate()' call in the error handling path
> of the probe, as already done in the remove function.
> 
> A successful 'venus_firmware_init()' call should be balanced by a
> corresponding 'venus_firmware_deinit()' call in the error handling path
> of the probe, as already done in the remove function.
> 
> Update the error handling path accordingly.
> 
> Fixes: f9799fcce4bb ("media: venus: firmware: register separate platform_device for firmware loader")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/media/platform/qcom/venus/core.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 91b15842c555..9cb0ab7d1677 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -349,11 +349,11 @@ static int venus_probe(struct platform_device *pdev)
>   
>   	ret = venus_firmware_init(core);
>   	if (ret)
> -		goto err_runtime_disable;
> +		goto err_of_depopulate;
>   
>   	ret = venus_boot(core);
>   	if (ret)
> -		goto err_runtime_disable;
> +		goto err_firmware_deinit;
>   
>   	ret = hfi_core_resume(core, true);
>   	if (ret)
> @@ -385,6 +385,10 @@ static int venus_probe(struct platform_device *pdev)
>   	v4l2_device_unregister(&core->v4l2_dev);
>   err_venus_shutdown:
>   	venus_shutdown(core);
> +err_firmware_deinit:
> +	venus_firmware_deinit(core);
> +err_of_depopulate:
> +	of_platform_depopulate(dev);
>   err_runtime_disable:
>   	pm_runtime_put_noidle(dev);
>   	pm_runtime_set_suspended(dev);
> 
Hi,

this was sent duing the summer holidays. Since then, a few other patches 
have been merged in linux-next for this file.

So, this is a polite reminder.

CJ

      reply	other threads:[~2021-11-11 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 20:05 Christophe JAILLET
2021-11-11 15:17 ` Christophe JAILLET [this message]

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=b7b1dbd7-9578-d34f-e8a3-0ce045485de0@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=acourbot@chromium.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®