summaryrefslogtreecommitdiffstats
path: root/drivers/vfio
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-05-15 04:04:58 +0200
committerAlex Williamson <alex.williamson@redhat.com>2021-05-24 20:14:18 +0200
commitd1ce2c79156d3baf0830990ab06d296477b93c26 (patch)
treeaf08d700bfb10cf857511d6824abfddc058a68b3 /drivers/vfio
parentLinux 5.13-rc2 (diff)
downloadlinux-d1ce2c79156d3baf0830990ab06d296477b93c26.tar.xz
linux-d1ce2c79156d3baf0830990ab06d296477b93c26.zip
vfio/pci: Fix error return code in vfio_ecap_init()
The error code returned from vfio_ext_cap_len() is stored in 'len', not in 'ret'. Fixes: 89e1f7d4c66d ("vfio: Add PCI device driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com> Message-Id: <20210515020458.6771-1-thunder.leizhen@huawei.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/pci/vfio_pci_config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c
index d57f037f65b8..70e28efbc51f 100644
--- a/drivers/vfio/pci/vfio_pci_config.c
+++ b/drivers/vfio/pci/vfio_pci_config.c
@@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
if (len == 0xFF) {
len = vfio_ext_cap_len(vdev, ecap, epos);
if (len < 0)
- return ret;
+ return len;
}
}