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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user