mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
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:
parent
b54074ffb8
commit
4f20c628b6
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user