Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1396091pxb; Wed, 10 Feb 2021 07:30:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNFgWoymIp8Lyn8NOZvbZ8B6CGzP4Q1SheOBAFNE5rv3nTKsqJosyV4AbKS8Ty2yXDBJTh X-Received: by 2002:a50:e008:: with SMTP id e8mr3561277edl.339.1612971031787; Wed, 10 Feb 2021 07:30:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612971031; cv=none; d=google.com; s=arc-20160816; b=BvFLt6UbeszOF2mnLGEOg3M5I7fWLpEGHABaod/ee39YpJa62aN9iD657+atBxG9We haXDNuFsI8brCJE3xWwwlXE2iro93FUco+p+XDQXGMuoZAyQdlNb71ENvqaHaHqqSqtL zyi3mDCdmDSsnaRv9vqGTG+l/k6ti90Hv3IqeOZAeW9aIuXuVoIli8Hgw6a1X1gr9ZWl uk0hFGYFib19SkoGGwj1JlUqZwhaZFGzTVKVCTneLRBodv1DiyFkhsNrYRG7HFzFFxGE 6nMp1yjyk/TJ+vPwoW/eNtmTJhoQV0fDu7ngcp1BmXvLJFBIyBE6GVNQ0QvEM4Rfsnfa A4Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=heUqb7AEPqk1gjim+Y7UG5pHANfmetXzDojuCBDi/Zw=; b=e3XoQrGtHTZgQ7zektQSIBxjmJStajwKX/DsShYH8GNreFuj2UC3DZiEWYQtX89h7H etsCJ0IqRcP1jIcWwUUeDILg+BWwiHeQ/bfodVq/Lx/p2SwkfyqkiO3NVaf1GVEx9ZzB yCIIG6o3dpI7A0srVujCMK18425R6pBRMgHnR2yKRlve646jo1jjbZzxSndgW5BSS6r8 5j3Ng+Z9kOVQnizDrdPhgnFC2BiTf2VaDGJpfGcvp62XarX9jVDTOV4aJZGpgzOLbPoU gegCVIkVXh6FeN9Ic04CiIU6DNPXlKqxHImb+6iKBb1xmY1uR7+rQwqtR9aKOIlbk7UV CdfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si1631359ejb.315.2021.02.10.07.30.07; Wed, 10 Feb 2021 07:30:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231768AbhBJP1g (ORCPT + 99 others); Wed, 10 Feb 2021 10:27:36 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:46462 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhBJP1e (ORCPT ); Wed, 10 Feb 2021 10:27:34 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l9rO9-0007dY-2z; Wed, 10 Feb 2021 15:26:45 +0000 From: Colin King To: Yisen Zhuang , Salil Mehta , "David S . Miller" , Jakub Kicinski , Huazhong Tan , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] net: hns3: Fix uninitialized return from function Date: Wed, 10 Feb 2021 15:26:44 +0000 Message-Id: <20210210152644.137770-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Currently function hns3_reset_notify_uninit_enet is returning the contents of the uninitialized variable ret. Fix this by removing ret (since it is no longer used) and replace it with a return of the literal value 0. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 64749c9c38a9 ("net: hns3: remove redundant return value of hns3_uninit_all_ring()") Signed-off-by: Colin Ian King --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 9565b7999426..bf4302a5cf95 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -4640,7 +4640,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) { struct net_device *netdev = handle->kinfo.netdev; struct hns3_nic_priv *priv = netdev_priv(netdev); - int ret; if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) { netdev_warn(netdev, "already uninitialized\n"); @@ -4662,7 +4661,7 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle) hns3_put_ring_config(priv); - return ret; + return 0; } static int hns3_reset_notify(struct hnae3_handle *handle, -- 2.30.0