kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/hns: Fix uninitialized variable in hns_roce_v2_query_qp()
@ 2017-10-03 10:54 Dan Carpenter
  2017-10-04 19:15 ` Doug Ledford
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-10-03 10:54 UTC (permalink / raw)
  To: Lijun Ou, Wei Hu
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

We accidentally return an uninitialized value if
(hr_qp->state = IB_QPS_RESET).  We should be returning success.

Fixes: 926a01dc000d ("RDMA/hns: Add QP operations support for hip08 SoC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 4171f73bdad5..e1c59dc066c9 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -2792,7 +2792,7 @@ static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
 	struct device *dev = hr_dev->dev;
 	int tmp_qp_state;
 	int state;
-	int ret;
+	int ret = 0;
 
 	context = kzalloc(sizeof(*context), GFP_KERNEL);
 	if (!context)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-04 19:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 10:54 [PATCH] RDMA/hns: Fix uninitialized variable in hns_roce_v2_query_qp() Dan Carpenter
2017-10-04 19:15 ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).