diff mbox series

media: atomisp: Fix runtime PM imbalance in atomisp_pci_probe

Message ID 20210408081850.24278-1-dinghao.liu@zju.edu.cn (mailing list archive)
State New
Headers show
Series media: atomisp: Fix runtime PM imbalance in atomisp_pci_probe | expand

Commit Message

Dinghao Liu April 8, 2021, 8:18 a.m. UTC
When hmm_pool_register() fails, a pairing PM usage counter
increment is needed to keep the counter balanced. It's the
same for the following error paths.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andy Shevchenko April 8, 2021, 9:50 a.m. UTC | #1
On Thu, Apr 8, 2021 at 11:19 AM Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
>
> When hmm_pool_register() fails, a pairing PM usage counter
> increment is needed to keep the counter balanced. It's the
> same for the following error paths.

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
> index 0295e2e32d79..02f774ed80c8 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
> @@ -1815,6 +1815,7 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
>         hmm_cleanup();
>         hmm_pool_unregister(HMM_POOL_TYPE_RESERVED);
>  hmm_pool_fail:
> +       pm_runtime_get_noresume(&pdev->dev);
>         destroy_workqueue(isp->wdt_work_queue);
>  wdt_work_queue_fail:
>         atomisp_acc_cleanup(isp);
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 0295e2e32d79..02f774ed80c8 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -1815,6 +1815,7 @@  static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 	hmm_cleanup();
 	hmm_pool_unregister(HMM_POOL_TYPE_RESERVED);
 hmm_pool_fail:
+	pm_runtime_get_noresume(&pdev->dev);
 	destroy_workqueue(isp->wdt_work_queue);
 wdt_work_queue_fail:
 	atomisp_acc_cleanup(isp);