backend/drm: Close non-master drm fd on failure

If we are not able to prepare the fd for non-master usage, close the fd
before returning an error.
This commit is contained in:
Kenny Levinsen 2026-02-19 14:17:33 +01:00 committed by Simon Ser
parent 884d29e5f3
commit 1efb216c6d

View file

@ -2104,6 +2104,7 @@ int wlr_drm_backend_get_non_master_fd(struct wlr_backend *backend) {
if (drmIsMaster(fd) && drmDropMaster(fd) < 0) {
wlr_log_errno(WLR_ERROR, "Failed to drop master");
close(fd);
return -1;
}