Browse Source

bnx2x: Fix possible memory leak on iov error flow

Commit 2dc33bbc4 "bnx2x: Remove the sriov VFOP mechanism" introduced a possible
memory leak on the error flow during multicast filters configuration.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yuval Mintz 11 years ago
parent
commit
dae98cadf7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

+ 2 - 0
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

@@ -595,6 +595,8 @@ int bnx2x_vf_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf,
 	rc = bnx2x_config_mcast(bp, &mcast, BNX2X_MCAST_CMD_DEL);
 	if (rc) {
 		BNX2X_ERR("Failed to remove multicasts\n");
+		if (mc)
+			kfree(mc);
 		return rc;
 	}