blob: 6e1b2a8a4a0e35d7ad0d0db15849c92c85d63565 [file] [log] [blame]
From: Lukas Wunner <>
Date: Wed, 8 Jun 2016 18:47:27 +0200
Subject: drm/radeon: Don't leak runtime pm ref on driver load
commit b875194679b0f88ffdb2e2d68435572296628551 upstream.
radeon_device_init() returns an error if either of the two calls to
radeon_init() fail. One level up in the call stack,
radeon_driver_load_kms() will then skip runtime pm initialization and
call radeon_driver_unload_kms(), which acquires a runtime pm ref that
is leaked.
Balance by releasing a runtime pm ref in the error path of
Fixes: 10ebc0bc0934 ("drm/radeon: add runtime PM support (v2)")
Cc: Dave Airlie <>
Cc: Alex Deucher <>
Signed-off-by: Lukas Wunner <>
Acked-by: Alex Deucher <>
Signed-off-by: Daniel Vetter <>
Signed-off-by: Ben Hutchings <>
drivers/gpu/drm/radeon/radeon_device.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -30,6 +30,7 @@
#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include <drm/radeon_drm.h>
+#include <linux/pm_runtime.h>
#include <linux/vgaarb.h>
#include <linux/vga_switcheroo.h>
#include <linux/efi.h>
@@ -1465,6 +1466,9 @@ int radeon_device_init(struct radeon_dev
return 0;
+ /* balance pm_runtime_get_sync() in radeon_driver_unload_kms() */
+ if (radeon_is_px(ddev))
+ pm_runtime_put_noidle(ddev->dev);
if (runtime)
return r;