[PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num()

Subsystems: cavium liquidio network driver, networking drivers, the rest

STALE2225d

2 messages, 2 authors, 2020-08-03 · open the first message on its own page

[PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num()

From: Tianjia Zhang <hidden>
Date: 2020-08-02 11:15:54

On an error exit path, a negative error code should be returned
instead of a positive return value.

Fixes: 0c45d7fe12c7e ("liquidio: fix use of pf in pass-through mode in a virtual machine")
Cc: Rick Farrington <redacted>
Signed-off-by: Tianjia Zhang <redacted>
---
 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
index 43d11c38b38a..4cddd628d41b 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
@@ -1167,7 +1167,7 @@ static int cn23xx_get_pf_num(struct octeon_device *oct)
 		oct->pf_num = ((fdl_bit >> CN23XX_PCIE_SRIOV_FDL_BIT_POS) &
 			       CN23XX_PCIE_SRIOV_FDL_MASK);
 	} else {
-		ret = EINVAL;
+		ret = -EINVAL;
 
 		/* Under some virtual environments, extended PCI regs are
 		 * inaccessible, in which case the above read will have failed.
-- 
2.26.2

Re: [PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num()

From: David Miller <davem@davemloft.net>
Date: 2020-08-03 22:58:11

From: Tianjia Zhang <redacted>
Date: Sun,  2 Aug 2020 19:15:44 +0800
On an error exit path, a negative error code should be returned
instead of a positive return value.

Fixes: 0c45d7fe12c7e ("liquidio: fix use of pf in pass-through mode in a virtual machine")
Cc: Rick Farrington <redacted>
Signed-off-by: Tianjia Zhang <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help