modesetting: Only close the dmabuf fd if it isn't -1

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111 2025-11-24 22:57:44 +02:00 • committed by Enrico Weigelt
commit c01c4e7c72

View file

@ -1798,15 +1798,15 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
ppix->devKind,
ppix->drawable.depth,
ppix->drawable.bitsPerPixel);
close(ihandle);
if (ihandle != -1) {
close(ihandle);
}
} else {
int size = ppix->devKind * ppix->drawable.height;
ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size);
}
if (ret == FALSE)
return ret;
return TRUE;
return ret;
#else
return FALSE;
#endif