]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2x: avoid leaking memory on bnx2x_init_one() failures
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 30 May 2016 13:00:54 +0000 (15:00 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 8 Jul 2016 02:28:49 +0000 (19:28 -0700)
commit7dc98f588e3d263103b3f1bd9a51c1ae189d31a1
tree00cbfa8f0f6435ca523a12419b85d7198e495efe
parent767c31172d6b3cc65b932d67942c08afd54fff76
bnx2x: avoid leaking memory on bnx2x_init_one() failures

bnx2x_init_bp() allocates memory with bnx2x_alloc_mem_bp() so if we
fail later in bnx2x_init_one() we need to free this memory
with bnx2x_free_mem_bp() to avoid leakages. E.g. I'm observing memory
leaks reported by kmemleak when a failure (unrelated) happens in
bnx2x_vfpf_acquire().

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c