vfio/pci: Fix error return code in vfio_ecap_init()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Signed-off-by Zhen Lei <[email protected]>
--- drivers/vfio/pci/vfio_pci_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vfio/pci/vfio_pci_config.c +1 -1
@@ -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; } }
Signature · 1 line
2.26.0.106.g9fadedd
Quoted 15 lines · Zhen Lei
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 <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- drivers/vfio/pci/vfio_pci_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vfio/pci/vfio_pci_config.c +0
-0
drivers/vfio/pci/vfio_pci_config.c static int vfio_ecap_init(struct vfio_pci_device *vdev) · line 1586
Quoted 7 lines
drivers/vfio/pci/vfio_pci_config.c +1
-1@@ -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; } }
Looks good,
Reviewed-by Max Gurtovoy <[email protected]>
Quoted 1 line
Quoted 15 lines · On Sat, 15 May 2021 10:04:58 +0800 Zhen Lei <[email protected]> wrote:
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 <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- drivers/vfio/pci/vfio_pci_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vfio/pci/vfio_pci_config.c +0
-0
drivers/vfio/pci/vfio_pci_config.c static int vfio_ecap_init(struct vfio_pci_device *vdev) · line 1587
Quoted 8 lines
drivers/vfio/pci/vfio_pci_config.c +1
-1@@ -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; } }
Added to vfio for-linus branch for v5.13 w/ Max's R-b. Thanks!
Alex