Skip to content

Commit dbd2f3b

Browse files
liuyonglong86davem330
authored andcommitted
net: hns3: fix variable may not initialized problem in hns3_init_mac_addr()
When a VF is calling hns3_init_mac_addr(), get_mac_addr() may return fail, then the value of mac_addr_temp is not initialized. Fixes: 76ad4f0 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> Signed-off-by: Jijie Shao <shaojijie@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 53aba45 commit dbd2f3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5139,7 +5139,7 @@ static int hns3_init_mac_addr(struct net_device *netdev)
51395139
struct hns3_nic_priv *priv = netdev_priv(netdev);
51405140
char format_mac_addr[HNAE3_FORMAT_MAC_ADDR_LEN];
51415141
struct hnae3_handle *h = priv->ae_handle;
5142-
u8 mac_addr_temp[ETH_ALEN];
5142+
u8 mac_addr_temp[ETH_ALEN] = {0};
51435143
int ret = 0;
51445144

51455145
if (h->ae_algo->ops->get_mac_addr)

0 commit comments

Comments
 (0)