Commit aa027850 authored by Tianjia Zhang's avatar Tianjia Zhang Committed by David S. Miller

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: 0c45d7fe ("liquidio: fix use of pf in pass-through mode in a virtual machine")
Cc: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: default avatarTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bace287c
...@@ -1167,7 +1167,7 @@ static int cn23xx_get_pf_num(struct octeon_device *oct) ...@@ -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) & oct->pf_num = ((fdl_bit >> CN23XX_PCIE_SRIOV_FDL_BIT_POS) &
CN23XX_PCIE_SRIOV_FDL_MASK); CN23XX_PCIE_SRIOV_FDL_MASK);
} else { } else {
ret = EINVAL; ret = -EINVAL;
/* Under some virtual environments, extended PCI regs are /* Under some virtual environments, extended PCI regs are
* inaccessible, in which case the above read will have failed. * inaccessible, in which case the above read will have failed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment