aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vfio')
-rw-r--r--hw/vfio/ccw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index bc78a0ad76..b2df708e4b 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -104,9 +104,9 @@ again:
goto again;
}
error_report("vfio-ccw: write I/O region failed with errno=%d", errno);
- ret = -errno;
+ ret = errno ? -errno : -EFAULT;
} else {
- ret = region->ret_code;
+ ret = 0;
}
switch (ret) {
case 0:
@@ -192,9 +192,9 @@ again:
goto again;
}
error_report("vfio-ccw: write cmd region failed with errno=%d", errno);
- ret = -errno;
+ ret = errno ? -errno : -EFAULT;
} else {
- ret = region->ret_code;
+ ret = 0;
}
switch (ret) {
case 0:
@@ -232,9 +232,9 @@ again:
goto again;
}
error_report("vfio-ccw: write cmd region failed with errno=%d", errno);
- ret = -errno;
+ ret = errno ? -errno : -EFAULT;
} else {
- ret = region->ret_code;
+ ret = 0;
}
switch (ret) {
case 0: