Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5217375imm; Tue, 31 Jul 2018 07:24:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJznTpDznASAxh5SK+XbbSbgOnspvoaqjy6PdEcDNVkNqHRmR/QfWcbtlnjuSyZIkqml8A X-Received: by 2002:a63:c60:: with SMTP id 32-v6mr20818929pgm.155.1533047048362; Tue, 31 Jul 2018 07:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533047048; cv=none; d=google.com; s=arc-20160816; b=j7PAlcYaE1tNt/ZHKH+kv08pwwzK1OGHgEfe7QuA8eFqdUBQTpkFvu/jsLasve6ca2 zhKExy+IStbDRdVLBWZ+OQ1ggojblTFj107nj8lMaYy3UZvJPlBlHi3HS6nkfdQweZ9j QvrDQvze/Wsjm7YJd/1XCjLnP26+r+yAvbaBXMhB9p+XRmJhL2715mrKPQ6Kj1/E6aef MRkSp6mdM4IyW9hqcRuPV4wRS1/ZiIRqmeBQ4z8I+ewg1eKeUOvf2Jt2xmWmeTmXrf9a iW38UJmdxCicVTOfc++F0aYSvAR5BUHOESEQewNh+mhojVwdBwZlhpC5qY5e09s874jZ xpHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=AmRq3emEvzZZReuBnb4H4alhLmGKxMFICu02q1pU/JY=; b=Npc6WO9pLnW2VpOnYNxJRieO1wfF1FTdIQRSylnNTaiuQ0xg9h/8+FdyQ0cHQ8FEoU +vWbrlRYkLvZx2jPRIU6F/Ss7pC8AqMFmraWtXQs8HoEnz4H/tkj2HiV/vMNHxMm6dy0 6VPPHG8sWVIwb/dvfill62mwvJyBUpBHwBEkia0PhrQK+r7+MI3kwwlFCu/sg1dqR07R 8NhVJOM/XqKfksRnjbc77/SLMfrHNheCkLD5RrQFxJkmtCTzeiJS06C0HekngfKKZOXD lZ5OoMrUyK1ju+ecoKNL56ZK8Aqm2+SMtifK2S3dIQoUJMAwESq1TY/0mTFyKOgzbqRo 3hfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 79-v6si13932447pfs.40.2018.07.31.07.23.54; Tue, 31 Jul 2018 07:24:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732352AbeGaQDC (ORCPT + 99 others); Tue, 31 Jul 2018 12:03:02 -0400 Received: from gateway33.websitewelcome.com ([192.185.146.195]:41983 "EHLO gateway33.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732222AbeGaQDB (ORCPT ); Tue, 31 Jul 2018 12:03:01 -0400 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 86EB98EA51 for ; Tue, 31 Jul 2018 09:22:28 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id kVXDfS9HqbXuJkVXUfsQwy; Tue, 31 Jul 2018 09:22:28 -0500 X-Authority-Reason: nr=8 Received: from [189.250.131.79] (port=46612 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1fkVXC-002OdQ-A4; Tue, 31 Jul 2018 09:21:58 -0500 Date: Tue, 31 Jul 2018 09:21:57 -0500 From: "Gustavo A. R. Silva" To: Tariq Toukan , Saeed Mahameed , Leon Romanovsky , "David S. Miller" Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] net/mlx5e: Fix uninitialized variable Message-ID: <20180731142157.GA24066@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.250.131.79 X-Source-L: No X-Exim-ID: 1fkVXC-002OdQ-A4 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.131.79]:46612 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 7 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a potential execution path in which variable *err* is returned without being properly initialized previously. Fix this by initializing variable *err* to 0. Addresses-Coverity-ID: 1472116 ("Uninitialized scalar variable") Fixes: 0ec13877ce95 ("net/mlx5e: Gather all XDP pre-requisite checks in a single function") Signed-off-by: Gustavo A. R. Silva --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index fde3502..de2827a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4215,7 +4215,7 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog) struct mlx5e_priv *priv = netdev_priv(netdev); struct bpf_prog *old_prog; bool reset, was_opened; - int err; + int err = 0; int i; mutex_lock(&priv->state_lock); -- 2.7.4