[PATCH] drm/radeon: drm/radeon: add missing radeon_semaphore_free to error path

Alex Deucher alexdeucher at gmail.com
Mon Apr 28 07:19:36 PDT 2014


On Thu, Apr 24, 2014 at 7:29 AM, Maarten Lankhorst
<maarten.lankhorst at canonical.com> wrote:
> It would appear this bug has been copy/pasted many times without being
> noticed.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>

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

> ---
> diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
> index f58a07c26b86..0e071571a4c6 100644
> --- a/drivers/gpu/drm/radeon/cik.c
> +++ b/drivers/gpu/drm/radeon/cik.c
> @@ -3670,6 +3670,7 @@ int cik_copy_cpdma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>  diff --git a/drivers/gpu/drm/radeon/cik_sdma.c
> b/drivers/gpu/drm/radeon/cik_sdma.c
> index 94626ea90fa5..06ca19cf5446 100644
> --- a/drivers/gpu/drm/radeon/cik_sdma.c
> +++ b/drivers/gpu/drm/radeon/cik_sdma.c
> @@ -564,6 +564,7 @@ int cik_copy_dma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>  diff --git a/drivers/gpu/drm/radeon/evergreen_dma.c
> b/drivers/gpu/drm/radeon/evergreen_dma.c
> index a37b54436382..e6b8c752e42c 100644
> --- a/drivers/gpu/drm/radeon/evergreen_dma.c
> +++ b/drivers/gpu/drm/radeon/evergreen_dma.c
> @@ -151,6 +151,7 @@ int evergreen_copy_dma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>  diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index 7a4ee41c7cab..fc9568547a97 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -2843,6 +2843,7 @@ int r600_copy_cpdma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>  diff --git a/drivers/gpu/drm/radeon/r600_dma.c
> b/drivers/gpu/drm/radeon/r600_dma.c
> index b2d4c91e6272..2590e2289303 100644
> --- a/drivers/gpu/drm/radeon/r600_dma.c
> +++ b/drivers/gpu/drm/radeon/r600_dma.c
> @@ -493,6 +493,7 @@ int r600_copy_dma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>  diff --git a/drivers/gpu/drm/radeon/rv770_dma.c
> b/drivers/gpu/drm/radeon/rv770_dma.c
> index aca8cbe8a335..bbf2e076ee45 100644
> --- a/drivers/gpu/drm/radeon/rv770_dma.c
> +++ b/drivers/gpu/drm/radeon/rv770_dma.c
> @@ -86,6 +86,7 @@ int rv770_copy_dma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>  diff --git a/drivers/gpu/drm/radeon/si_dma.c
> b/drivers/gpu/drm/radeon/si_dma.c
> index 59be2cfcbb47..e61ab2d7da41 100644
> --- a/drivers/gpu/drm/radeon/si_dma.c
> +++ b/drivers/gpu/drm/radeon/si_dma.c
> @@ -215,6 +215,7 @@ int si_copy_dma(struct radeon_device *rdev,
>         r = radeon_fence_emit(rdev, fence, ring->idx);
>         if (r) {
>                 radeon_ring_unlock_undo(rdev, ring);
> +               radeon_semaphore_free(rdev, &sem, NULL);
>                 return r;
>         }
>
> _______________________________________________
> 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