Commit 82e75d73 authored by Frediano Ziglio's avatar Frediano Ziglio Committed by Jiri Slaby

drm/qxl: Do not leak memory if qxl_release_list_add fails

commit 8451cc96 upstream.

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: default avatarFrediano Ziglio <fziglio@redhat.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 75efb898
...@@ -122,8 +122,10 @@ static struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev, ...@@ -122,8 +122,10 @@ static struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
qobj = gem_to_qxl_bo(gobj); qobj = gem_to_qxl_bo(gobj);
ret = qxl_release_list_add(release, qobj); ret = qxl_release_list_add(release, qobj);
if (ret) if (ret) {
drm_gem_object_unreference_unlocked(gobj);
return NULL; return NULL;
}
return qobj; return qobj;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment