From: Wenpeng Liang <liangwenpeng@huawei.com>
To: <dledford@redhat.com>, <jgg@nvidia.com>
Cc: <linux-rdma@vger.kernel.org>, <linuxarm@huawei.com>,
<liangwenpeng@huawei.com>
Subject: [PATCH for-next 1/3] RDMA/hns: Bugfix for data type of dip_idx
Date: Wed, 25 Aug 2021 17:43:10 +0800 [thread overview]
Message-ID: <1629884592-23424-2-git-send-email-liangwenpeng@huawei.com> (raw)
In-Reply-To: <1629884592-23424-1-git-send-email-liangwenpeng@huawei.com>
From: Junxian Huang <huangjunxian4@hisilicon.com>
dip_idx is associated with qp_num whose data type is u32. However, dip_idx
is incorrectly defined as u8 data in the hns_roce_dip struct, which leads
to data truncation during value assignment.
Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW")
Signed-off-by: Junxian Huang <huangjunxian4@hisilicon.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
---
drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
index 54c1223..0b91a1a 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h
@@ -1441,7 +1441,7 @@ struct hns_roce_v2_priv {
struct hns_roce_dip {
u8 dgid[GID_LEN_V2];
- u8 dip_idx;
+ u32 dip_idx;
struct list_head node; /* all dips are on a list */
};
--
2.8.1
next prev parent reply other threads:[~2021-08-25 9:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-25 9:43 [PATCH for-next 0/3] RDMA/hns: Fix some errors in the congestion control algorithm Wenpeng Liang
2021-08-25 9:43 ` Wenpeng Liang [this message]
2021-08-25 9:43 ` [PATCH for-next 2/3] RDMA/hns: Bugfix for the missing assignment for dip_idx Wenpeng Liang
2021-08-25 9:43 ` [PATCH for-next 3/3] RDMA/hns: Bugfix for incorrect association between dip_idx and dgid Wenpeng Liang
2021-08-25 17:50 ` [PATCH for-next 0/3] RDMA/hns: Fix some errors in the congestion control algorithm Jason Gunthorpe
2021-08-26 11:41 ` Wenpeng Liang
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=1629884592-23424-2-git-send-email-liangwenpeng@huawei.com \
--to=liangwenpeng@huawei.com \
--cc=dledford@redhat.com \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.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 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).