mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-15 22:58:05 +02:00
intel/virtio: Preserve errno properly when handling ioctl
Avoid changing errno when ioctl succeeds.
Fixes: b06d759a93 ("intel: Add virtio-gpu native context")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15446
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41512>
This commit is contained in:
parent
0429a73f47
commit
85cb633871
1 changed files with 3 additions and 3 deletions
|
|
@ -696,15 +696,15 @@ intel_virtio_prime_handle_to_fd(struct intel_virtio_device *dev,
|
|||
int
|
||||
intel_virtio_ioctl(int fd, unsigned long cmd, void *req)
|
||||
{
|
||||
int orig_errno = errno;
|
||||
struct intel_virtio_device *dev = fd_to_intel_virtio_device(fd);
|
||||
|
||||
if (!dev) {
|
||||
errno = orig_errno;
|
||||
/* this is a real phys device if not bound to virtio */
|
||||
return intel_virtio_ioctl_errno(fd, cmd, req);
|
||||
return ioctl(fd, cmd, req);
|
||||
}
|
||||
|
||||
int orig_errno = errno;
|
||||
|
||||
/*
|
||||
* Special case for legacy ioctls that have same NR as extended ioctl
|
||||
* and need to be handled differently.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue