Skip to content

Commit bbe516e

Browse files
dinghaoliumchehab
authored andcommitted
media: venus: core: Fix runtime PM imbalance in venus_probe
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. For other error paths after this call, things are the same. Fix this by adding pm_runtime_put_noidle() after 'err_runtime_disable' label. But in this case, the error path after pm_runtime_put_sync() will decrease PM usage counter twice. Thus add an extra pm_runtime_get_noresume() in this path to balance PM counter. Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 5cef078 commit bbe516e

File tree

1 file changed

+4
-1
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+4
-1
lines changed

drivers/media/platform/qcom/venus/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,10 @@ static int venus_probe(struct platform_device *pdev)
287287
goto err_core_deinit;
288288

289289
ret = pm_runtime_put_sync(dev);
290-
if (ret)
290+
if (ret) {
291+
pm_runtime_get_noresume(dev);
291292
goto err_dev_unregister;
293+
}
292294

293295
return 0;
294296

@@ -299,6 +301,7 @@ static int venus_probe(struct platform_device *pdev)
299301
err_venus_shutdown:
300302
venus_shutdown(core);
301303
err_runtime_disable:
304+
pm_runtime_put_noidle(dev);
302305
pm_runtime_set_suspended(dev);
303306
pm_runtime_disable(dev);
304307
hfi_destroy(core);

0 commit comments

Comments
 (0)