diff options
author | Jesper Juhl <jj@chaosbits.net> | 2012-07-31 07:39:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-02 03:19:17 -0400 |
commit | 8b6d5c09bc0c49aea041486d77c2f67e98ae0bc3 (patch) | |
tree | 41f7f5a284019ff2c4f2cc31877dd947d27796f1 /drivers/net/ethernet/broadcom/bnx2x | |
parent | e3c0d04750751389d5116267f8cf4687444d9a50 (diff) |
bnx2x: fix mem leak when command is unknown
In bnx2x_mcast_enqueue_cmd() we'll leak the memory allocated to
'new_cmd' if we hit the deafault case of the 'switch (cmd)'.
Add a 'kfree(new_cmd)' to that case to avoid the leak.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 734fd87cd990..62f754bd0dfe 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |||
@@ -2485,6 +2485,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp, | |||
2485 | break; | 2485 | break; |
2486 | 2486 | ||
2487 | default: | 2487 | default: |
2488 | kfree(new_cmd); | ||
2488 | BNX2X_ERR("Unknown command: %d\n", cmd); | 2489 | BNX2X_ERR("Unknown command: %d\n", cmd); |
2489 | return -EINVAL; | 2490 | return -EINVAL; |
2490 | } | 2491 | } |