mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-28 07:58:59 -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.
(cherry picked from commit 1efb216c6d)
This commit is contained in:
parent
b858230394
commit
11f5ba8bf2
1 changed files with 1 additions and 0 deletions
|
|
@ -2085,6 +2085,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