Commit d1ce2c79 authored by Zhen Lei's avatar Zhen Lei Committed by Alex Williamson
Browse files

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: 89e1f7d4 ("vfio: Add PCI device driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: default avatarMax Gurtovoy <mgurtovoy@nvidia.com>
Message-Id: <20210515020458.6771-1-thunder.leizhen@huawei.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent d07f6ca9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
			}
		}