diff options
author | Jesper Juhl <jj@chaosbits.net> | 2012-02-06 11:28:21 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-07 13:13:33 -0500 |
commit | 3f61cd879c2f112c468e8849949b6fc88c739679 (patch) | |
tree | 85bbd91351b97c20623dc65a0b5afe64720ae090 /ipc | |
parent | da0912868527913eba15f5ebcfb420b32a037f1a (diff) |
bnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails.
We allocate memory for 'new_data' with kmalloc(). If we get the memory
we then try to build_skb() and if that should fail (which it can) we
do not enter 'if (likely(skb)) {' and actually use 'new_data' but
instead fall through to the 'drop:' label and end up returning from
the function without ever assigning 'new'data' to anything or freeing
it. That leaks the memory allocated to 'new_data'.
This patch fixes the memory leak by doing a kfree(new_data) in the
case where build_skb() fails (or where allocation of 'new_data' itself
fails, but in taht case it's just a harmless kfree(NULL)).
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions