]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: hns3: check msg_data before memcpy in hclgevf_send_mbx_msg
authorWeihang Li <liweihang@hisilicon.com>
Thu, 4 Jul 2019 14:04:25 +0000 (22:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2019 22:39:38 +0000 (15:39 -0700)
commit0bae5cf25d66156ae3eb9ca20a1ad9bc4aa35a6d
treed17509d3eaeacd2b8b0b5ba17a8ec8fcd4e78610
parentc09ba484563c17f90ec91b46322c31d3440acc42
net: hns3: check msg_data before memcpy in hclgevf_send_mbx_msg

The value of msg_data may be NULL in some cases, which will cause
errors reported by some compiler.

So this patch adds a check to fix it.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c