IB/core: Fix possible memory leak in cma_resolve_iboe_route()
authorWei Yongjun <weiyj.lk@gmail.com>
Fri, 5 Aug 2016 13:46:49 +0000 (13:46 +0000)
committerDoug Ledford <dledford@redhat.com>
Mon, 22 Aug 2016 18:26:54 +0000 (14:26 -0400)
commit23d70503ee187819a3775c7ac73f17c5bfe3fad0
tree6a1c01eb9faa567cc2d9e050d9c9738a9c213391
parent8303f683b161467b6595c153c8751b80f9df3508
IB/core: Fix possible memory leak in cma_resolve_iboe_route()

'work' and 'route->path_rec' are malloced in cma_resolve_iboe_route()
and should be freed before leaving from the error handling cases,
otherwise it will cause memory leak.

Fixes: 200298326b27 ('IB/core: Validate route when we init ah')
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cma.c