All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/qxl: Fix a missing unreserve in an error path
@ 2026-10-26 20:00 Bart Van Assche
  2026-10-26 20:05 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2026-10-26 20:00 UTC (permalink / raw)
  To: dri-devel
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, spice-devel, linux-kernel, Bart Van Assche,
	Dave Airlie, Gerd Hoffmann, virtualization

If qxl_bo_reserve() succeeds and ttm_bo_validate() fails,
qxl_update_area_ioctl() returns without calling qxl_bo_unreserve().
This leaves the buffer object reserved and causes later attempts to
reserve it to hang. Fix this by calling qxl_bo_unreserve() in that
error path.

This has been detected by the Clang thread-safety analyzer.
Compile-tested only.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux.dev
Fixes: f64122c1f6ad ("drm: add new QXL driver. (v1.4)")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/gpu/drm/qxl/qxl_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
index 591b026ceff9..40c1eca77b39 100644
--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -323,7 +323,7 @@ int qxl_update_area_ioctl(struct drm_device *dev, void *data, struct drm_file *f
 		qxl_ttm_placement_from_domain(qobj, qobj->type);
 		ret = ttm_bo_validate(&qobj->tbo, &qobj->placement, &ctx);
 		if (unlikely(ret))
-			goto out;
+			goto out2;
 	}
 
 	ret = qxl_bo_check_id(qdev, qobj);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/qxl: Fix a missing unreserve in an error path
  2026-10-26 20:00 [PATCH] drm/qxl: Fix a missing unreserve in an error path Bart Van Assche
@ 2026-10-26 20:05 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-26 20:05 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: virtualization, Michael S. Tsirkin, Eugenio Perez

> If qxl_bo_reserve() succeeds and ttm_bo_validate() fails,
> qxl_update_area_ioctl() returns without calling qxl_bo_unreserve().
> This leaves the buffer object reserved and causes later attempts to
> reserve it to hang. Fix this by calling qxl_bo_unreserve() in that
> error path.
> 
> This has been detected by the Clang thread-safety analyzer.
> Compile-tested only.
> 
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: virtualization@lists.linux.dev
> Fixes: f64122c1f6ad ("drm: add new QXL driver. (v1.4)")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/4879712fc70d92a04de63eb81a673cd3d023af80.1793044836.git.bvanassche@acm.org?part=1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-26 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-26 20:00 [PATCH] drm/qxl: Fix a missing unreserve in an error path Bart Van Assche
2026-10-26 20:05 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.