Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af902ae4 authored by Ariel Elior's avatar Ariel Elior Committed by David S. Miller
Browse files

bnx2x: VF ndo sanity



If iproute2 VF callbacks are invoked before PF is loaded,
abort gracefully.

Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 78c3bcc5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;