]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/hns: Fix usage of bitmap allocation functions return values
authorGal Pressman <pressmangal@gmail.com>
Thu, 9 Aug 2018 19:00:47 +0000 (22:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:49 +0000 (09:46 +0200)
commit08100b285966e0fe90a33c607c5fc42094d9d746
tree3580832f66432c38df4fb286c50202531b51dac3
parent59e8e46ada765101d24dd5a608c3f8f24c0143d6
RDMA/hns: Fix usage of bitmap allocation functions return values

[ Upstream commit a1ceeca679dccc492235f0f629d9e9f7b3d51ca8 ]

hns bitmap allocation functions return 0 on success and -1 on failure.
Callers of these functions wrongly used their return value as an errno,
fix that by making a proper conversion.

Fixes: a598c6f4c5a8 ("IB/hns: Simplify function of pd alloc and qp alloc")
Signed-off-by: Gal Pressman <pressmangal@gmail.com>
Acked-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hns/hns_roce_pd.c
drivers/infiniband/hw/hns/hns_roce_qp.c