* [PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num()
@ 2020-08-02 11:15 Tianjia Zhang
2020-08-03 22:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Tianjia Zhang @ 2020-08-02 11:15 UTC (permalink / raw)
To: dchickles, sburla, fmanlunas, davem, kuba, ricardo.farrington
Cc: netdev, linux-kernel, tianjia.zhang
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 <ricardo.farrington@cavium.com>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num()
2020-08-02 11:15 [PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num() Tianjia Zhang
@ 2020-08-03 22:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-03 22:58 UTC (permalink / raw)
To: tianjia.zhang
Cc: dchickles, sburla, fmanlunas, kuba, ricardo.farrington, netdev,
linux-kernel, tianjia.zhang
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
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 <ricardo.farrington@cavium.com>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-03 22:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02 11:15 [PATCH] liquidio: Fix wrong return value in cn23xx_get_pf_num() Tianjia Zhang
2020-08-03 22:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).