[Devel] [PATCH RHEL7 COMMIT] ms/drm/qxl: qxl_release leak in qxl_hw_surface_alloc()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Apr 27 14:05:59 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1127.vz7.150.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.vz7.150.4
------>
commit b2a0ccf92742a720fa4c566ad14e5281b87a099a
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Mon Apr 27 14:05:58 2020 +0300

    ms/drm/qxl: qxl_release leak in qxl_hw_surface_alloc()
    
    Cc: stable at vger.kernel.org
    mFixes: 8002db6336dd ("qxl: convert qxl driver to proper use for reservations")
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 drivers/gpu/drm/qxl/qxl_cmd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c
index dffc5093ff16b..89cddf62b22e0 100644
--- a/drivers/gpu/drm/qxl/qxl_cmd.c
+++ b/drivers/gpu/drm/qxl/qxl_cmd.c
@@ -475,9 +475,10 @@ int qxl_hw_surface_alloc(struct qxl_device *qdev,
 		return ret;
 
 	ret = qxl_release_reserve_list(release, true);
-	if (ret)
+	if (ret) {
+		qxl_release_free(qdev, release);
 		return ret;
-
+	}
 	cmd = (struct qxl_surface_cmd *)qxl_release_map(qdev, release);
 	cmd->type = QXL_SURFACE_CMD_CREATE;
 	cmd->flags = QXL_SURF_FLAG_KEEP_DATA;


More information about the Devel mailing list