bnx2x: avoid leaking memory on bnx2x_init_one() failures
authorVitaly Kuznetsov <[email protected]>
Mon, 30 May 2016 13:00:54 +0000 (15:00 +0200)
committerDavid S. Miller <[email protected]>
Tue, 31 May 2016 21:10:34 +0000 (14:10 -0700)
commitbae5499cc55d2329ea0fbf09cb22298f4ca2f9bd
tree3b751f3b323264584adf7b07a4c24ba16a454a99
parent95e4daa82086e2bd7b7163f33a4f455bf8ecdf48
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 <[email protected]>
Acked-by: Yuval Mintz <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c