]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hns: fix memory leak on ah on error return path
authorColin Ian King <colin.king@canonical.com>
Tue, 8 Aug 2017 17:41:02 +0000 (18:41 +0100)
committerDoug Ledford <dledford@redhat.com>
Wed, 16 Aug 2017 15:30:33 +0000 (11:30 -0400)
commit4309114414c5e81f00c0275caf1219fdd671c589
tree940d528d54ef8bb6b51f82225ecd41a1b96b056e
parent4bbb79ae8c5e910081641f115b4eacc86f67174e
IB/hns: fix memory leak on ah on error return path

When dmac is NULL, ah is not being freed on the error return path. Fix
this by kfree'ing it.

Detected by CoverityScan, CID#1452636 ("Resource Leak")

Fixes: d39bda349927 ("IB/core: Use rdma_ah_attr accessor functions")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_ah.c