drm/radeon: check return value of radeon_ring_lock()
authorjsg <jsg@openbsd.org>
Mon, 29 Jan 2024 01:30:49 +0000 (01:30 +0000)
committerjsg <jsg@openbsd.org>
Mon, 29 Jan 2024 01:30:49 +0000 (01:30 +0000)
From Nikita Zhandarovich
18bd4d184675fbb2fc4b2f9b80aaebea2e05fca0 in linux-6.6.y/6.6.14
71225e1c930942cb1e042fc08c5cc0c4ef30e95e in mainline linux

sys/dev/pci/drm/radeon/si.c

index 46d03be..e542f22 100644 (file)
@@ -3611,6 +3611,10 @@ static int si_cp_start(struct radeon_device *rdev)
        for (i = RADEON_RING_TYPE_GFX_INDEX; i <= CAYMAN_RING_TYPE_CP2_INDEX; ++i) {
                ring = &rdev->ring[i];
                r = radeon_ring_lock(rdev, ring, 2);
+               if (r) {
+                       DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r);
+                       return r;
+               }
 
                /* clear the compute context state */
                radeon_ring_write(ring, PACKET3_COMPUTE(PACKET3_CLEAR_STATE, 0));