Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] media: bdisp: Fix runtime PM imbalance on error
@ 2020-05-21 10:00 Dinghao Liu
  2020-05-25 12:41 ` Fabien DESSENNE
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-21 10:00 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Fabien Dessenne, Mauro Carvalho Chehab, linux-media, linux-kernel

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index af2d5eb782ce..e1d150584bdc 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -1371,7 +1371,7 @@ static int bdisp_probe(struct platform_device *pdev)
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
 		dev_err(dev, "failed to set PM\n");
-		goto err_dbg;
+		goto err_pm;
 	}
 
 	/* Filters */
@@ -1399,7 +1399,6 @@ static int bdisp_probe(struct platform_device *pdev)
 	bdisp_hw_free_filters(bdisp->dev);
 err_pm:
 	pm_runtime_put(dev);
-err_dbg:
 	bdisp_debugfs_remove(bdisp);
 err_v4l2:
 	v4l2_device_unregister(&bdisp->v4l2_dev);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: bdisp: Fix runtime PM imbalance on error
  2020-05-21 10:00 [PATCH] media: bdisp: Fix runtime PM imbalance on error Dinghao Liu
@ 2020-05-25 12:41 ` Fabien DESSENNE
  0 siblings, 0 replies; 2+ messages in thread
From: Fabien DESSENNE @ 2020-05-25 12:41 UTC (permalink / raw)
  To: Dinghao Liu, kjlu; +Cc: Mauro Carvalho Chehab, linux-media, linux-kernel

Hi,

Looks good to me.

Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>

BR

Fabien


On 21/05/2020 12:00 pm, Dinghao Liu wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when it returns an error code. Thus a pairing decrement is needed on
> the error handling path to keep the counter balanced.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>   drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> index af2d5eb782ce..e1d150584bdc 100644
> --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
> @@ -1371,7 +1371,7 @@ static int bdisp_probe(struct platform_device *pdev)
>   	ret = pm_runtime_get_sync(dev);
>   	if (ret < 0) {
>   		dev_err(dev, "failed to set PM\n");
> -		goto err_dbg;
> +		goto err_pm;
>   	}
>   
>   	/* Filters */
> @@ -1399,7 +1399,6 @@ static int bdisp_probe(struct platform_device *pdev)
>   	bdisp_hw_free_filters(bdisp->dev);
>   err_pm:
>   	pm_runtime_put(dev);
> -err_dbg:
>   	bdisp_debugfs_remove(bdisp);
>   err_v4l2:
>   	v4l2_device_unregister(&bdisp->v4l2_dev);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 10:00 [PATCH] media: bdisp: Fix runtime PM imbalance on error Dinghao Liu
2020-05-25 12:41 ` Fabien DESSENNE

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git