Skip to content

Commit d1ce2c7

Browse files
Zhen Leiawilliam
authored andcommitted
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: 89e1f7d ("vfio: Add PCI device driver") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zhen Lei <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Message-Id: <[email protected]> Signed-off-by: Alex Williamson <[email protected]>
1 parent d07f6ca commit d1ce2c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vfio/pci/vfio_pci_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)
15811581
if (len == 0xFF) {
15821582
len = vfio_ext_cap_len(vdev, ecap, epos);
15831583
if (len < 0)
1584-
return ret;
1584+
return len;
15851585
}
15861586
}
15871587

0 commit comments

Comments
 (0)