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)
commitda315679e80635021e98de1306ff4eee0759ba57
tree35ce69487bed726b3225d9bd320dd80d50e6a328
parent67e2c3883828b39548cee2091b36656787775d95
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: a0eacca948d2 ('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