You need to sign in or sign up before continuing.
提交 7aefde00 编写于 作者: L liweihang 提交者: Xie XiuQi

net: hns3: check msg_data before memcpy

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Value of msg_data is NULL in some situation, which may cause errors reported
from some complier.

Feature or Bugfix: Bugfix
Signed-off-by: Nliweihang <liweihang@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 308d1dc6
......@@ -129,7 +129,8 @@ int hclgevf_send_mbx_msg(struct hclgevf_dev *hdev, u16 code, u16 subcode,
~HCLGE_MBX_NEED_RESP_BIT;
req->msg[0] = code;
req->msg[1] = subcode;
memcpy(&req->msg[2], msg_data, msg_len);
if (msg_data)
memcpy(&req->msg[2], msg_data, msg_len);
/* synchronous send */
if (need_resp) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册