drm/radeon: fix double free in radeon_gpu_reset
authorChristian König <deathsimple@vodafone.de>
Wed, 29 Aug 2012 11:24:15 +0000 (13:24 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Aug 2012 16:11:01 +0000 (12:11 -0400)
radeon_ring_restore is freeing the memory for the saved
ring data. We need to remember that, otherwise we try to
restore the ring data again on the next try. Additional
to that it shouldn't try the reset infinitely if we have
saved ring data.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_device.c

index 33da8bff8942f83ab502756867fb865e1cb310b7..7a3daebd732d67d85d40dc04d6aa851af42aae26 100644 (file)
@@ -1346,12 +1346,15 @@ retry:
                for (i = 0; i < RADEON_NUM_RINGS; ++i) {
                        radeon_ring_restore(rdev, &rdev->ring[i],
                                            ring_sizes[i], ring_data[i]);
+                       ring_sizes[i] = 0;
+                       ring_data[i] = NULL;
                }
 
                r = radeon_ib_ring_tests(rdev);
                if (r) {
                        dev_err(rdev->dev, "ib ring test failed (%d).\n", r);
                        if (saved) {
+                               saved = false;
                                radeon_suspend(rdev);
                                goto retry;
                        }