]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: Fix memory leaks in ib_link_query_port()
authorJesper Juhl <jj@chaosbits.net>
Wed, 11 Apr 2012 21:43:29 +0000 (23:43 +0200)
committerRoland Dreier <roland@purestorage.com>
Tue, 24 Apr 2012 23:11:21 +0000 (16:11 -0700)
commit689e51bb4455842f374d343164da807e43902372
tree866e0dedc84ce00105a009b701e8801b6fbe1622
parent321534157363a48672eb14d02bab9f757d91aa7c
IB/mlx4: Fix memory leaks in ib_link_query_port()

If the call to mlx4_MAD_IFC() fails in ib_link_query_port() we will
currently do 'return err;' which will leak 'in_mad' and 'out_mad'.  We
should instead do 'goto out;' where we'll properly free the memory we
previously allocated.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/mlx4/main.c