mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
backend/drm: use wlr_drm_backend.name for fd cloning
This also fixes a memleak.
This commit is contained in:
parent
8dff1bb9bd
commit
92ff86db23
1 changed files with 1 additions and 7 deletions
|
@ -1820,16 +1820,10 @@ int wlr_drm_backend_get_non_master_fd(struct wlr_backend *backend) {
|
||||||
assert(backend);
|
assert(backend);
|
||||||
|
|
||||||
struct wlr_drm_backend *drm = get_drm_backend_from_backend(backend);
|
struct wlr_drm_backend *drm = get_drm_backend_from_backend(backend);
|
||||||
char *path = drmGetDeviceNameFromFd2(drm->fd);
|
int fd = open(drm->name, O_RDWR | O_CLOEXEC);
|
||||||
if (!path) {
|
|
||||||
wlr_log(WLR_ERROR, "Failed to get device name from DRM fd");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int fd = open(path, O_RDWR | O_CLOEXEC);
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
wlr_log_errno(WLR_ERROR, "Unable to clone DRM fd for client fd");
|
wlr_log_errno(WLR_ERROR, "Unable to clone DRM fd for client fd");
|
||||||
free(path);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue