]> git.hungrycats.org Git - linux/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:21:25 +0000 (15:21 +0200)
commit575a715454ea32e2e569b31b2d9a4ecfc9bb985a
treea60a5ddcf22d2baf47c7b091396339e7236261e5
parent3157e7e748ceb7d532d43209ff5951038f3e5d7d
IB/core: Fix possible memory leak in cma_resolve_iboe_route()

commit 23d70503ee187819a3775c7ac73f17c5bfe3fad0 upstream.

'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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/cma.c