Thread (87 messages) flat view 87 messages, 8 authors, 2021-06-16
STALE1910d REVIEWED: 1 (1M)

1 review trailer.

[PATCH 5.4 09/78] vfio/pci: Fix error return code in vfio_ecap_init()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-06-08 18:49:02
Also in: lkml
Subsystem: the rest, vfio driver · Maintainers: Linus Torvalds, Alex Williamson

From: Zhen Lei <redacted>

[ 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 <redacted>
Signed-off-by: Zhen Lei <redacted>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Message-Id: [off-list ref]
Signed-off-by: Alex Williamson <redacted>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vfio/pci/vfio_pci_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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;
 			}
 		}
 
-- 
2.30.2


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help