Skip to content

Commit

Permalink
RDMA/hns: Bugfix for data type of dip_idx
Browse files Browse the repository at this point in the history
[ Upstream commit 4303e61 ]

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: f91696f ("RDMA/hns: Support congestion control type selection according to the FW")
Link: https://lore.kernel.org/r/1629884592-23424-2-git-send-email-liangwenpeng@huawei.com
Signed-off-by: Junxian Huang <huangjunxian4@hisilicon.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Junxian Huang authored and gregkh committed Sep 18, 2021
1 parent 6a8099c commit c034d38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hns/hns_roce_hw_v2.h
Expand Up @@ -1784,7 +1784,7 @@ struct hns_roce_eq_context {

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 */
};

Expand Down

0 comments on commit c034d38

Please sign in to comment.