提交 8451cc96 编写于 作者: F Frediano Ziglio 提交者: Dave Airlie

drm/qxl: Do not leak memory if qxl_release_list_add fails

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: NFrediano Ziglio <fziglio@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: NDave Airlie <airlied@redhat.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 2fa19535
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册