]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/radeon: Do not kfree() devres managed rdev
authorDaniel Palmer <daniel@0x0f.com>
Sat, 18 Oct 2025 05:44:50 +0000 (14:44 +0900)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Oct 2025 14:59:56 +0000 (10:59 -0400)
Since the allocation of the drivers main structure was changed to
devm_drm_dev_alloc() rdev is managed by devres and we shouldn't be calling
kfree() on it.

This fixes things exploding if the driver probe fails and devres cleans up
the rdev after we already free'd it.

Fixes: a9ed2f052c5c ("drm/radeon: change drm_dev_alloc to devm_drm_dev_alloc")
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 16c0681617b8a045773d4d87b6140002fa75b03b)

drivers/gpu/drm/radeon/radeon_kms.c

index 645e33bf7947eec1b3a8c8d4cac614cf7731fbe9..ba1446acd7032434785b259c77419752a2c5fc46 100644 (file)
@@ -84,7 +84,6 @@ void radeon_driver_unload_kms(struct drm_device *dev)
        rdev->agp = NULL;
 
 done_free:
-       kfree(rdev);
        dev->dev_private = NULL;
 }