media: atomisp: Fix runtime PM imbalance in atomisp_pci_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 8 Apr 2021 08:18:43 +0000 (10:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:20 +0000 (13:40 +0200)
[ Upstream commit 672fe1cf145ab9978c62eb827d6a16aa6b63994b ]

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.

Link: https://lore.kernel.org/linux-media/20210408081850.24278-1-dinghao.liu@zju.edu.cn
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index 0295e2e32d7973d7750615e482df8fd183096d87..02f774ed80c8aa271db9af65dd8a8d77e9a89107 100644 (file)
@@ -1815,6 +1815,7 @@ request_irq_fail:
        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);