diff options
author | Tianjia Zhang <tianjia.zhang@linux.alibaba.com> | 2020-08-02 14:15:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-04 01:57:31 +0300 |
commit | aa027850a292ea65524b8fab83eb91a124ad362c (patch) | |
tree | 82efb69e2208bc44cd7745f34d01fcf9da787feb /drivers | |
parent | bace287c55aa7b66b217701d290801ed810702b1 (diff) | |
download | linux-aa027850a292ea65524b8fab83eb91a124ad362c.tar.xz |
liquidio: Fix wrong return value in cn23xx_get_pf_num()
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 |
1 files changed, 1 insertions, 1 deletions
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. |