AI code review points out:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
index 7fec13bbe60e..c8944c51e6bf 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_nic_cfg.c
[ ... ]
+int hinic3_set_rx_vlan_offload(struct hinic3_hwdev *hwdev, u8 en)
+{
+ struct l2nic_cmd_vlan_offload vlan_cfg = {};
^^^^
Note the zero initialization here.
[ ... ]
+int hinic3_set_vlan_filter(struct hinic3_hwdev *hwdev, u32 vlan_filter_ctrl)
+{
+ struct l2nic_cmd_set_vlan_filter vlan_filter;
^
Should this be zero-initialized with = {} like the other similar
functions in this file (hinic3_set_rx_lro, hinic3_set_rx_lro_timer,
hinic3_set_rx_vlan_offload)?
When hinic3_send_mbox_to_mgmt() fails, vlan_filter.msg_head.status
contains garbage which is then printed in the dev_err() message below.
Additionally, the uninitialized rsvd[2] and msg_head fields are sent to
the firmware in the mailbox message.
+ struct mgmt_msg_params msg_params = {};
+ int err;