* [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-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
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)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] RDMA/hns: Fix uninitialized variable in hns_roce_v2_query_qp()
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
0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2017-10-04 19:15 UTC (permalink / raw)
To: Dan Carpenter, Lijun Ou, Wei Hu
Cc: Sean Hefty, Hal Rosenstock, linux-rdma, kernel-janitors
On Tue, 2017-10-03 at 13:54 +0300, Dan Carpenter wrote:
> 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>
Hi Dan, I already took in another patch that solves the same issue.
Thanks.
>
> 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)
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
^ permalink raw reply [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).