Skip to content

Commit 71225e1

Browse files
Nikita Zhandarovichalexdeucher
authored andcommitted
drm/radeon: check return value of radeon_ring_lock()
In the unlikely event of radeon_ring_lock() failing, its errno return value should be processed. This patch checks said return value and prints a debug message in case of an error. Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE. Fixes: 48c0c90 ("drm/radeon/kms: add support for CP setup on SI") Signed-off-by: Nikita Zhandarovich <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b5c5baa commit 71225e1

File tree

1 file changed

+4
-0
lines changed
  • drivers/gpu/drm/radeon

1 file changed

+4
-0
lines changed

drivers/gpu/drm/radeon/si.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3611,6 +3611,10 @@ static int si_cp_start(struct radeon_device *rdev)
36113611
for (i = RADEON_RING_TYPE_GFX_INDEX; i <= CAYMAN_RING_TYPE_CP2_INDEX; ++i) {
36123612
ring = &rdev->ring[i];
36133613
r = radeon_ring_lock(rdev, ring, 2);
3614+
if (r) {
3615+
DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r);
3616+
return r;
3617+
}
36143618

36153619
/* clear the compute context state */
36163620
radeon_ring_write(ring, PACKET3_COMPUTE(PACKET3_CLEAR_STATE, 0));

0 commit comments

Comments
 (0)