diff options
author | Christian König <christian.koenig@amd.com> | 2013-10-14 05:32:28 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-10-18 16:16:16 -0400 |
commit | 5510f124c6ee53cb52cf632240aea982d64c7d99 (patch) | |
tree | 9398a9ff0bcaaf52765d0840277c488d40d9a9ec /drivers/gpu/drm | |
parent | c23632d4e57c0dd20bf50eca08fa0eb8ad3ff680 (diff) |
drm/radeon: stop the leaks in cik_ib_test
Stop leaking IB memory and scratch register space when the test fails.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index b874ccdf52f7..8f393dfbd0e3 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -3182,6 +3182,7 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
3182 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); | 3182 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); |
3183 | if (r) { | 3183 | if (r) { |
3184 | DRM_ERROR("radeon: failed to get ib (%d).\n", r); | 3184 | DRM_ERROR("radeon: failed to get ib (%d).\n", r); |
3185 | radeon_scratch_free(rdev, scratch); | ||
3185 | return r; | 3186 | return r; |
3186 | } | 3187 | } |
3187 | ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1); | 3188 | ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1); |
@@ -3198,6 +3199,8 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
3198 | r = radeon_fence_wait(ib.fence, false); | 3199 | r = radeon_fence_wait(ib.fence, false); |
3199 | if (r) { | 3200 | if (r) { |
3200 | DRM_ERROR("radeon: fence wait failed (%d).\n", r); | 3201 | DRM_ERROR("radeon: fence wait failed (%d).\n", r); |
3202 | radeon_scratch_free(rdev, scratch); | ||
3203 | radeon_ib_free(rdev, &ib); | ||
3201 | return r; | 3204 | return r; |
3202 | } | 3205 | } |
3203 | for (i = 0; i < rdev->usec_timeout; i++) { | 3206 | for (i = 0; i < rdev->usec_timeout; i++) { |