]> git.ipfire.org Git - people/arne_f/kernel.git/commit
IB/mthca: fix return value of error branch in mthca_init_cq()
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Fri, 20 Nov 2020 01:57:02 +0000 (09:57 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 23 Nov 2020 20:22:34 +0000 (16:22 -0400)
commit6830ff853a5764c75e56750d59d0bbb6b26f1835
tree5d1680796571170e6c4637a31f189b43acabb134
parent418baf2c28f3473039f2f7377760bd8f6897ae18
IB/mthca: fix return value of error branch in mthca_init_cq()

We return 'err' in the error branch, but this variable may be set as zero
by the above code. Fix it by setting 'err' as a negative value before we
goto the error label.

Fixes: 74c2174e7be5 ("IB uverbs: add mthca user CQ support")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://lore.kernel.org/r/1605837422-42724-1-git-send-email-wangxiongfeng2@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mthca/mthca_cq.c