summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYuval Mintz <Yuval.Mintz@qlogic.com>2016-05-15 14:48:05 +0300
committerDavid S. Miller <davem@davemloft.net>2016-05-16 13:59:18 -0400
commitb0409fa0940b59dc0c313eb424cfbc4730778ecc (patch)
tree8fd6e20ea1cd8ec76f9909b6e86240939d005ba7 /drivers
parent2bb07e155bb3e0c722c806723f737cf8020961ef (diff)
downloadlinux-b0409fa0940b59dc0c313eb424cfbc4730778ecc.tar.bz2
qed: Correct PF-sanity check
Seems like something broke in commit 1408cc1fa48c ("qed: Introduce VFs") and the function no longer verifies that the vf is indeed a valid one. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_sriov.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.c b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
index d4df406ac0a4..2c4f9b038db2 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_sriov.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.c
@@ -476,12 +476,12 @@ int qed_iov_hw_info(struct qed_hwfn *p_hwfn)
static bool qed_iov_pf_sanity_check(struct qed_hwfn *p_hwfn, int vfid)
{
/* Check PF supports sriov */
- if (!IS_QED_SRIOV(p_hwfn->cdev) || !IS_PF_SRIOV_ALLOC(p_hwfn))
+ if (IS_VF(p_hwfn->cdev) || !IS_QED_SRIOV(p_hwfn->cdev) ||
+ !IS_PF_SRIOV_ALLOC(p_hwfn))
return false;
/* Check VF validity */
- if (IS_VF(p_hwfn->cdev) || !IS_QED_SRIOV(p_hwfn->cdev) ||
- !IS_PF_SRIOV_ALLOC(p_hwfn))
+ if (!qed_iov_is_valid_vfid(p_hwfn, vfid, true))
return false;
return true;