RDMA/hns: return 0 rather than return a garbage status value
Subsystems (3)
PATCH 1/1 RDMA/hns: return 0 rather than return a garbage status value
From: Colin Ian King <[email protected]>
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")
--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +1 -0
@@ -2805,6 +2805,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; }
Signature · 1 line
2.14.1
Thanks, Colin Ian King
Quoted 25 lines · Colin King
From: Colin Ian King <[email protected]>
For the case where
hr_qp->state=IB_QPS_RESET, an uninitialized value in ret is being returned by functionhns_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 <[email protected]>--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 + 1 file changed, 1 insertion(+)drivers/infiniband/hw/hns/hns_roce_hw_v2.c +1
-0@@ -2805,6 +2805,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; }
Doug Ledford
AppliedQuoted 9 lines · Colin King
From: Colin Ian King <[email protected]>
For the case where
hr_qp->state=IB_QPS_RESET, an uninitialized value in ret is being returned by functionhns_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 <[email protected]>
Thanks, applied.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD