Skip to content

Commit

Permalink
RDMA/hns: Fix uninitialized variable
Browse files Browse the repository at this point in the history
[ Upstream commit 2a38c0f ]

A random value will be returned if the condition below is not met, so it
needs to be initialized.

Fixes: 9ea9a53 ("RDMA/hns: Add mapped page count checking for MTR")
Link: https://lore.kernel.org/r/1624011020-16992-3-git-send-email-liweihang@huawei.com
Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yixing Liu authored and gregkh committed Jul 14, 2021
1 parent 3523af4 commit 9007ce9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hns/hns_roce_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ int hns_roce_mtr_map(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr,
struct ib_device *ibdev = &hr_dev->ib_dev;
struct hns_roce_buf_region *r;
unsigned int i, mapped_cnt;
int ret;
int ret = 0;

/*
* Only use the first page address as root ba when hopnum is 0, this
Expand Down

0 comments on commit 9007ce9

Please sign in to comment.