1
0
Fork 0

liquidio: Fix wrong return value in cn23xx_get_pf_num()

[ Upstream commit aa027850a2 ]

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

Fixes: 0c45d7fe12 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Tianjia Zhang 2020-08-02 19:15:44 +08:00 committed by Greg Kroah-Hartman
parent eb4afeaf86
commit dc66a35ffe
1 changed files with 1 additions and 1 deletions

View File

@ -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.