2020-05-23 11:51:39

by Dinghao Liu

[permalink] [raw]
Subject: [PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe

When platform_get_resource() returns an error code, a
pairing runtime PM usage counter decrement is needed
to keep the counter balanced.

Signed-off-by: Dinghao Liu <[email protected]>
---
drivers/media/platform/davinci/vpif.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c
index df66461f5d4f..f28c1b27eac6 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -458,6 +458,7 @@ static int vpif_probe(struct platform_device *pdev)
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res_irq) {
dev_warn(&pdev->dev, "Missing IRQ resource.\n");
+ pm_runtime_put(&pdev->dev);
return -EINVAL;
}

--
2.17.1


2020-05-27 19:18:46

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH] media: vpif: Fix runtime PM imbalance in vpif_probe

Hi Dinghao,

Thank you for the patch.

On Sat, May 23, 2020 at 12:49 PM Dinghao Liu <[email protected]> wrote:
>
> When platform_get_resource() returns an error code, a
> pairing runtime PM usage counter decrement is needed
> to keep the counter balanced.
>
> Signed-off-by: Dinghao Liu <[email protected]>
> ---
> drivers/media/platform/davinci/vpif.c | 1 +
> 1 file changed, 1 insertion(+)
>
Reviewed-by: Lad Prabhakar <[email protected]>

Cheers,
--Prabhakar

> diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c
> index df66461f5d4f..f28c1b27eac6 100644
> --- a/drivers/media/platform/davinci/vpif.c
> +++ b/drivers/media/platform/davinci/vpif.c
> @@ -458,6 +458,7 @@ static int vpif_probe(struct platform_device *pdev)
> res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> if (!res_irq) {
> dev_warn(&pdev->dev, "Missing IRQ resource.\n");
> + pm_runtime_put(&pdev->dev);
> return -EINVAL;
> }
>
> --
> 2.17.1
>