From 11a52e30952b129bdd3ebd2c20a9d31a1cb774ed Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Tue, 23 Sep 2025 19:08:45 +0800 Subject: [PATCH] modesetting: fix shared pixmap dmabuf fd leakage After the dmabuf fd exported by another screen is imported to a pixmap, the pixmap holds a reference for the buffer, thus the FD itself finished its job and needs to be closed to prevent a stale reference to the buffer. Signed-off-by: Icenowy Zheng --- hw/xfree86/drivers/modesetting/driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index d7958806b..019fc0945 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -1877,6 +1877,7 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) ppix->devKind, ppix->drawable.depth, ppix->drawable.bitsPerPixel); + close(ihandle); } else { int size = ppix->devKind * ppix->drawable.height; ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size);