]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 May 2016 21:10:34 +0000 (14:10 -0700)
commit6a679631ada68a4c52c7a3e4c1600fcd091cd930
tree3b751f3b323264584adf7b07a4c24ba16a454a99
parentb95aa96ea8ac71f35efa3cb56915466404955615
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>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c