[PATCH] drm/i915/selftests: Fix runtime PM imbalance on error

From: Dinghao Liu
Date: Sat May 23 2020 - 22:09:37 EST


When drm_dev_init() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep
the counter balanced. For error paths after this call,
things are the same.

Signed-off-by: Dinghao Liu <dinghao.liu@xxxxxxxxxx>
---
drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 754d0eb6beaa..fdf01461acc6 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -200,6 +200,7 @@ struct drm_i915_private *mock_gem_device(void)
drm_mode_config_cleanup(&i915->drm);
drm_dev_fini(&i915->drm);
put_device:
+ pm_runtime_put_noidle(&pdev->dev);
put_device(&pdev->dev);
err:
return NULL;
--
2.17.1