From 1c2301b05baefe4e224adb93e1b642df4edca3f2 Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 13 Apr 2021 14:25:45 +0100 Subject: pci: use ERROR_INT() (#430) Signed-off-by: John Levon Reviewed-by: Thanos Makatos --- lib/libvfio-user.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libvfio-user.c') diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index b0bfbbe..c86713a 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -216,6 +216,9 @@ region_access(vfu_ctx_t *vfu_ctx, size_t region_index, char *buf, if (region_index == VFU_PCI_DEV_CFG_REGION_IDX) { ret = pci_config_space_access(vfu_ctx, buf, count, offset, is_write); + if (ret == -1) { + ret = -errno; + } } else if (is_migr_reg(vfu_ctx, region_index) && vfu_ctx->migration != NULL) { ret = migration_region_access(vfu_ctx, buf, count, offset, is_write); } else { -- cgit v1.1