[PATCH] drm/radeon: fix double free in radeon_gpu_reset

Alex Deucher alexdeucher at gmail.com
Wed Aug 29 06:54:56 PDT 2012


On Wed, Aug 29, 2012 at 7:24 AM, Christian König
<deathsimple at vodafone.de> wrote:
> 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 at vodafone.de>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/radeon/radeon_device.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index d2e2438..814194f 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -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;
>                         }
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list