diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-29 21:13:08 +0100 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-10-04 14:40:07 -0400 |
commit | 63ea641f496ffe08b7d81589a1e1e1c43a6af9bd (patch) | |
tree | b3429f23ac1cf66db8a0ff4c2e1bee60a1856aac | |
parent | 988e175b9df683ac8c465fca60d64dbe9e4dd81e (diff) | |
download | op-kernel-dev-63ea641f496ffe08b7d81589a1e1e1c43a6af9bd.zip op-kernel-dev-63ea641f496ffe08b7d81589a1e1e1c43a6af9bd.tar.gz |
RDMA/hns: return 0 rather than return a garbage status value
For the case where hr_qp->state == IB_QPS_RESET, an uninitialized
value in ret is being returned by function hns_roce_v2_query_qp.
Fix this by setting ret to 0 for this specific return condition.
Detected by CoverityScan, CID#1457203 ("Unitialized scalar variable")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 8378ee1..b99d70a 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -2807,6 +2807,7 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, if (hr_qp->state == IB_QPS_RESET) { qp_attr->qp_state = IB_QPS_RESET; + ret = 0; goto done; } |