Skip to content

Commit

Permalink
drm/qxl: Do not leak memory if qxl_release_list_add fails
Browse files Browse the repository at this point in the history
If the function fails reference counter to the object is not decremented
causing leaks.
This is hard to spot as it happens only on very low memory situations.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Cc: stable@vger.kernel.org
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 2fa1953 commit 8451cc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/qxl/qxl_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ static struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
qobj = gem_to_qxl_bo(gobj);

ret = qxl_release_list_add(release, qobj);
if (ret)
if (ret) {
drm_gem_object_unreference_unlocked(gobj);
return NULL;
}

return qobj;
}
Expand Down

0 comments on commit 8451cc9

Please sign in to comment.