From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
To: Colin King <colin.king@canonical.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>
Cc: Lijun Ou <oulijun@huawei.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/hns: return 0 rather than return a garbage status value
Date: Sat, 30 Sep 2017 07:11:05 +0000 [thread overview]
Message-ID: <59CF4389.6050103@huawei.com> (raw)
In-Reply-To: <20170929201308.4704-1-colin.king@canonical.com>
Thanks, Colin Ian King
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
On 2017/9/30 4:13, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index 4870b51caab9..791dae72e775 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -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;
> }
>
WARNING: multiple messages have this Message-ID (diff)
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
To: Colin King <colin.king@canonical.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>
Cc: Lijun Ou <oulijun@huawei.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/hns: return 0 rather than return a garbage status value
Date: Sat, 30 Sep 2017 15:11:05 +0800 [thread overview]
Message-ID: <59CF4389.6050103@huawei.com> (raw)
In-Reply-To: <20170929201308.4704-1-colin.king@canonical.com>
Thanks, Colin Ian King
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
On 2017/9/30 4:13, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index 4870b51caab9..791dae72e775 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -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;
> }
>
WARNING: multiple messages have this Message-ID (diff)
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
To: Colin King <colin.king@canonical.com>,
Doug Ledford <dledford@redhat.com>,
Sean Hefty <sean.hefty@intel.com>
Cc: Lijun Ou <oulijun@huawei.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
<linux-rdma@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/hns: return 0 rather than return a garbage status value
Date: Sat, 30 Sep 2017 15:11:05 +0800 [thread overview]
Message-ID: <59CF4389.6050103@huawei.com> (raw)
In-Reply-To: <20170929201308.4704-1-colin.king@canonical.com>
Thanks, Colin Ian King
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
On 2017/9/30 4:13, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index 4870b51caab9..791dae72e775 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -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;
> }
>
next prev parent reply other threads:[~2017-09-30 7:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 20:13 [PATCH] RDMA/hns: return 0 rather than return a garbage status value Colin King
2017-09-29 20:13 ` Colin King
2017-09-29 20:13 ` Colin King
2017-09-30 7:11 ` Wei Hu (Xavier) [this message]
2017-09-30 7:11 ` Wei Hu (Xavier)
2017-09-30 7:11 ` Wei Hu (Xavier)
2017-10-04 18:40 ` Doug Ledford
2017-10-04 18:40 ` Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59CF4389.6050103@huawei.com \
--to=xavier.huwei@huawei.com \
--cc=colin.king@canonical.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=oulijun@huawei.com \
--cc=sean.hefty@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.