RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()
[ Upstream commit c64e9710f9241e38a1c761ed1c1a30854784da66 ]
ucmd in hns_roce_create_qp_common() are not initialized. But it works fine
until new member sdb_addr is added to struct hns_roce_ib_create_qp.
If the user-mode driver uses an old version ABI, then the value of the new
member will be undefined after ib_copy_from_udata().
This patch fixes it by initialize this variable to 0. And the default value
of the new member sdb_addr will be 0 which is invalid.
Fixes: 0425e3e6e0 ("RDMA/hns: Support flush cqe for hip08 in kernel space")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231017125239.164455-3-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7c09504c37
commit
1000adbac3
1 changed files with 1 additions and 1 deletions
|
|
@ -1128,7 +1128,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
|
||||||
{
|
{
|
||||||
struct hns_roce_ib_create_qp_resp resp = {};
|
struct hns_roce_ib_create_qp_resp resp = {};
|
||||||
struct ib_device *ibdev = &hr_dev->ib_dev;
|
struct ib_device *ibdev = &hr_dev->ib_dev;
|
||||||
struct hns_roce_ib_create_qp ucmd;
|
struct hns_roce_ib_create_qp ucmd = {};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mutex_init(&hr_qp->mutex);
|
mutex_init(&hr_qp->mutex);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue