IB/hns: Fix bug of memory leakage for registering user mr
authorLijun Ou <oulijun@huawei.com>
Tue, 20 Sep 2016 16:07:03 +0000 (17:07 +0100)
committerDoug Ledford <dledford@redhat.com>
Mon, 3 Oct 2016 15:43:15 +0000 (11:43 -0400)
commit1cd11064da4b0bca992ca0f9594adbf53df25879
treeac621e1c433ac5dcc7ce3f3a7d2b4c638c6502e7
parent49fdf6bb0a172a8fe631d89a421857336efc4382
IB/hns: Fix bug of memory leakage for registering user mr

While the page size attribute of umem is illegal, we should release
umem that get by ib_umem_get interface.

Also, we should return a non-zero value while pbl number is wrong.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Dongdong Huang(Donald) <hdd.huang@huawei.com>
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_mr.c