]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: hns3: set maximum length to resp_data_len for exceptional case
authorPeng Li <lipeng321@huawei.com>
Thu, 4 Jul 2019 14:04:28 +0000 (22:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2019 22:39:38 +0000 (15:39 -0700)
commit892951524647d593d9f5e540a56fef4e52b95c03
treec49b0b72c33729b4e41f42528f7e16c83461366e
parentb9a8f88373c586e357c8c203b657407437040e40
net: hns3: set maximum length to resp_data_len for exceptional case

If HCLGE_MBX_MAX_RESP_DATA_SIZE > HCLGE_MBX_MAX_RESP_DATA_SIZE,
the memcpy will cause out of memory. So this patch just set
resp_data_len to the maximum length for this case.

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/hns3pf/hclge_mbx.c