mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
virgl: Bail out on file descriptor duplication failure
Do not try to use a negative file descriptor. CID: 1465120 Argument cannot be negative Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34816>
This commit is contained in:
parent
965f41b550
commit
77c0ff9fc7
1 changed files with 2 additions and 0 deletions
|
|
@ -1364,6 +1364,8 @@ virgl_drm_screen_create(int fd, const struct pipe_screen_config *config)
|
|||
} else {
|
||||
struct virgl_winsys *vws;
|
||||
int dup_fd = os_dupfd_cloexec(fd);
|
||||
if (dup_fd < 0)
|
||||
goto unlock;
|
||||
|
||||
vws = virgl_drm_winsys_create(dup_fd);
|
||||
if (!vws) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue