From 72fa62af01241859ae953016954e6680a25d6b4c Mon Sep 17 00:00:00 2001 From: Nagarjuna Kristam Date: Fri, 24 Mar 2023 11:56:31 +0530 Subject: [PATCH] NET: tvnet: Fix Coverity issues Initialize ctrl_msg to 0 before passing to function. Bug 3956683 Signed-off-by: Nagarjuna Kristam Change-Id: I540d7d8bcc20003da5c5faea2d0d081da25527bd Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2876299 Reviewed-by: svcacv Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Manikanta Maddireddy Reviewed-by: Bitan Biswas GVS: Gerrit_Virtual_Submit --- drivers/net/ethernet/nvidia/pcie/tegra_vnet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/nvidia/pcie/tegra_vnet.c b/drivers/net/ethernet/nvidia/pcie/tegra_vnet.c index 4ffd561b..1cfceae8 100644 --- a/drivers/net/ethernet/nvidia/pcie/tegra_vnet.c +++ b/drivers/net/ethernet/nvidia/pcie/tegra_vnet.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. */ #include @@ -277,7 +277,7 @@ static void tvnet_host_update_link_sm(struct tvnet_priv *tvnet) /* One way link state machine*/ static void tvnet_host_user_link_up_req(struct tvnet_priv *tvnet) { - struct ctrl_msg msg; + struct ctrl_msg msg = {}; tvnet_host_clear_data_msg_counters(tvnet); tvnet_host_alloc_empty_buffers(tvnet); @@ -289,7 +289,7 @@ static void tvnet_host_user_link_up_req(struct tvnet_priv *tvnet) static void tvnet_host_user_link_down_req(struct tvnet_priv *tvnet) { - struct ctrl_msg msg; + struct ctrl_msg msg = {}; tvnet->rx_link_state = DIR_LINK_STATE_SENT_DOWN; msg.msg_id = CTRL_MSG_LINK_DOWN; @@ -305,7 +305,7 @@ static void tvnet_host_rcv_link_up_msg(struct tvnet_priv *tvnet) static void tvnet_host_rcv_link_down_msg(struct tvnet_priv *tvnet) { - struct ctrl_msg msg; + struct ctrl_msg msg = {}; /* Stop using empty buffers of remote system */ tvnet_host_stop_tx_queue(tvnet);