From dae98cadf743daa480c357b7ba4410423c5f905f Mon Sep 17 00:00:00 2001 From: Yuval Mintz Date: Thu, 27 Mar 2014 13:46:37 +0200 Subject: [PATCH] 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 Signed-off-by: Yuval Mintz Signed-off-by: Ariel Elior Signed-off-by: David S. Miller --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index df1507288b3c..5c523b32db70 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/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; } -- 2.39.5