]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: fix memory leak in bnx2x_init_firmware()
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 15 Mar 2012 14:08:29 +0000 (14:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Mar 2012 08:57:26 +0000 (01:57 -0700)
commit018160f492bbb88c64823955e27f0b131fd0b578
tree372e3246e5f51cf490a760e1d49de60263d53d2e
parentd0f75586ff5c2c5616fd13991dfff62e60dab9a2
bnx2x: fix memory leak in bnx2x_init_firmware()

When cycling the interface down and up, bnx2x_init_firmware() knows that
the firmware is already loaded, but nevertheless it allocates certain
arrays anew (init_data, init_ops, init_ops_offsets, iro_arr). The old
arrays are leaked.

Fix the leaks by returning early if the firmware was already loaded.
Because if the firmware is loaded, so are the arrays.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c