mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-13 05:34:13 -04:00
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:
parent
884d29e5f3
commit
1efb216c6d
1 changed files with 1 additions and 0 deletions
|
|
@ -2104,6 +2104,7 @@ int wlr_drm_backend_get_non_master_fd(struct wlr_backend *backend) {
|
||||||
|
|
||||||
if (drmIsMaster(fd) && drmDropMaster(fd) < 0) {
|
if (drmIsMaster(fd) && drmDropMaster(fd) < 0) {
|
||||||
wlr_log_errno(WLR_ERROR, "Failed to drop master");
|
wlr_log_errno(WLR_ERROR, "Failed to drop master");
|
||||||
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue