From: Shaozhengchao shaozhengchao@huawei.com
driver inclusion category:bugfix bugzilla:4472 CVE:NA
-----------------------------------------------------------------------
Magic number rectification
Signed-off-by: Shaozhengchao shaozhengchao@huawei.com Reviewed-by: Luoshaokai luoshaokai@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/huawei/hinic/hinic_ethtool.c | 2 +- drivers/net/ethernet/huawei/hinic/hinic_hwdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c index ac711da..92bad0e 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c @@ -1429,7 +1429,7 @@ static int __hinic_set_coalesce(struct net_device *netdev, struct hinic_nic_dev *nic_dev = netdev_priv(netdev); struct hinic_intr_coal_info intr_coal = {0}; struct hinic_intr_coal_info *ori_intr_coal; - char obj_str[32] = {0}; + char obj_str[OBJ_STR_MAX_LEN] = {0}; u16 i; int err = 0;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c b/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c index c2454f6..8d6675c 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c @@ -3890,8 +3890,8 @@ static void hinic_mctp_get_host_info_event_handler(struct hinic_hwdev *hwdev, static void __print_cable_info(struct hinic_hwdev *hwdev, struct hinic_link_info *info) { - char tmp_str[512] = {0}; - char tmp_vendor[17] = {0}; + char tmp_str[CAP_INFO_MAC_LEN] = {0}; + char tmp_vendor[VENDOR_MAX_LEN] = {0}; char *port_type = "Unknown port type"; int i; int err = 0;