diff options
author | Nikita Zhandarovich <n.zhandarovich@fintech.ru> | 2023-08-08 11:04:16 -0700 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-11-30 18:26:31 -0500 |
commit | 71225e1c930942cb1e042fc08c5cc0c4ef30e95e (patch) | |
tree | 59a68d45055942a232c87a0a6252b63531d9665c /drivers/gpu/drm/radeon/si.c | |
parent | b5c5baa458faa5430c445acd9a17481274d77ccf (diff) | |
download | linux-stable-71225e1c930942cb1e042fc08c5cc0c4ef30e95e.tar.gz linux-stable-71225e1c930942cb1e042fc08c5cc0c4ef30e95e.tar.bz2 linux-stable-71225e1c930942cb1e042fc08c5cc0c4ef30e95e.zip |
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: 48c0c902e2e6 ("drm/radeon/kms: add support for CP setup on SI")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/si.c')
-rw-r--r-- | drivers/gpu/drm/radeon/si.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index a91012447b56..85e9cba49cec 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -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)); |