diff options
author | Ariel Elior <ariele@broadcom.com> | 2013-06-20 18:39:09 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-24 10:54:15 +0400 |
commit | af902ae4432ba8650a5f16a2cca58507a5f566bd (patch) | |
tree | 26dda9de79f42d8dd2c3dd72c8e36c9f91da3f04 /drivers/net/ethernet/broadcom | |
parent | 78c3bcc5d1af64f51d9f30b0f5a2d1985bf69734 (diff) | |
download | linux-af902ae4432ba8650a5f16a2cca58507a5f566bd.tar.xz |
bnx2x: VF ndo sanity
If iproute2 VF callbacks are invoked before PF is loaded,
abort gracefully.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 2a8ad6d4b540..f6177baf20b7 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c @@ -3083,6 +3083,11 @@ void bnx2x_disable_sriov(struct bnx2x *bp) static int bnx2x_vf_ndo_sanity(struct bnx2x *bp, int vfidx, struct bnx2x_virtf *vf) { + if (bp->state != BNX2X_STATE_OPEN) { + BNX2X_ERR("vf ndo called though PF is down\n"); + return -EINVAL; + } + if (!IS_SRIOV(bp)) { BNX2X_ERR("vf ndo called though sriov is disabled\n"); return -EINVAL; |