Skip to content

Commit c64e971

Browse files
Chengchang Tangrleon
authored andcommitted
RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common()
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: 0425e3e ("RDMA/hns: Support flush cqe for hip08 in kernel space") Signed-off-by: Chengchang Tang <[email protected]> Signed-off-by: Junxian Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 9faef73 commit c64e971

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
10641064
{
10651065
struct hns_roce_ib_create_qp_resp resp = {};
10661066
struct ib_device *ibdev = &hr_dev->ib_dev;
1067-
struct hns_roce_ib_create_qp ucmd;
1067+
struct hns_roce_ib_create_qp ucmd = {};
10681068
int ret;
10691069

10701070
mutex_init(&hr_qp->mutex);

0 commit comments

Comments
 (0)