Skip to content

Commit

Permalink
drm/qxl: Handle all errors in qxl_surface_evict
Browse files Browse the repository at this point in the history
Only EBUSY error was handled. This could cause code to believe
reserve was successful while it failed.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Frediano Ziglio authored and Dave Airlie committed Jun 5, 2015
1 parent fe2af53 commit c610c71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/qxl/qxl_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stal
int ret;

ret = qxl_bo_reserve(surf, false);
if (ret == -EBUSY)
return -EBUSY;
if (ret)
return ret;

if (stall)
mutex_unlock(&qdev->surf_evict_mutex);
Expand All @@ -628,9 +628,9 @@ static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stal

if (stall)
mutex_lock(&qdev->surf_evict_mutex);
if (ret == -EBUSY) {
if (ret) {
qxl_bo_unreserve(surf);
return -EBUSY;
return ret;
}

qxl_surface_evict_locked(qdev, surf, true);
Expand Down

0 comments on commit c610c71

Please sign in to comment.