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.

(cherry picked from commit 1efb216c6d)
This commit is contained in:
Kenny Levinsen 2026-02-19 14:17:33 +01:00 committed by Simon Zeni
parent b858230394
commit 11f5ba8bf2

View file

@ -2085,6 +2085,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;
}