]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: Fixed memory leak and incorrect refcount in mlx4_load_one
authorMatan Barak <matanb@mellanox.com>
Sun, 14 Dec 2014 14:18:04 +0000 (16:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Dec 2014 16:34:53 +0000 (11:34 -0500)
commita5eec358873213c563f0e5a9ea7698ce38d8981f
tree35ce69487bed726b3225d9bd320dd80d50e6a328
parentc627d3709b083a20728e786e5c594248e36e583c
net/mlx4_core: Fixed memory leak and incorrect refcount in mlx4_load_one

The current mlx4_load_one has a memory leak as it always allocates
dev_cap, but frees it only on error.

In addition, even if VFs exist when mlx4_load_one is called,
we still need to notify probed VFs that we're loading (by
incrementing pf_loading).

Fixes: cf0a97205c60 ('net/mlx4_core: Refactor mlx4_load_one')
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c