net: hns3: set msg->desc to NULL after kfree in hclge_query_reg_info()

In hclge_query_reg_info(), msg->desc is freed by kfree(), but the
caller continues to use msg across loop iterations. Set msg->desc
to NULL to avoid leaving a dangling pointer in the reused struct.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260807095435.2959246-2-shaojijie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Jian Shen 2026-08-07 17:54:33 +08:00 committed by Paolo Abeni
parent b54074ffb8
commit 4f20c628b6

View File

@ -1592,6 +1592,7 @@ hclge_query_reg_info(struct hclge_dev *hdev,
}
kfree(msg->desc);
msg->desc = NULL;
}
static void hclge_query_reg_info_of_ssu(struct hclge_dev *hdev)