diff options
author | 2021-05-15 10:04:58 +0800 | |
---|---|---|
committer | 2021-06-10 13:37:03 +0200 | |
commit | 5da371c3fdfb32a2d7e1dfd86a85b8c17a02c3d1 (patch) | |
tree | 56f304610ed22d47878abf4002602440f18f8c49 /drivers/vfio/pci/vfio_pci_config.c | |
parent | efi: cper: fix snprintf() use in cper_dimm_err_location() (diff) | |
download | wireguard-linux-5da371c3fdfb32a2d7e1dfd86a85b8c17a02c3d1.tar.xz wireguard-linux-5da371c3fdfb32a2d7e1dfd86a85b8c17a02c3d1.zip |
vfio/pci: Fix error return code in vfio_ecap_init()
[ Upstream commit d1ce2c79156d3baf0830990ab06d296477b93c26 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/vfio/pci/vfio_pci_config.c | 2 |
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 bf32997c557f..50cd17fcf754 100644 --- a/drivers/vfio/pci/vfio_pci_config.c +++ b/drivers/vfio/pci/vfio_pci_config.c @@ -1576,7 +1576,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; } } |