These functions wrap ioctl(). When ioctl() fails, it sets @errno.
The wrappers then return that @errno negated.
Except they call accel_ioctl_end() between calling ioctl() and reading
@errno. accel_ioctl_end() can clobber @errno, e.g. when a futex()
system call fails. Seems unlikely, but it's a bug all the same.
Fix by retrieving @errno before calling accel_ioctl_end().
Fixes:
|
||
|---|---|---|
| .. | ||
| kvm-accel-ops.c | ||
| kvm-all.c | ||
| kvm-cpus.h | ||
| meson.build | ||
| trace-events | ||
| trace.h | ||