Received: by 10.223.176.5 with SMTP id f5csp2563617wra; Thu, 1 Feb 2018 02:26:10 -0800 (PST) X-Google-Smtp-Source: AH8x226bV/cAQsBjxZ3waUU+SRLRpioE+72NFgWszIIjYm8EzCg09U3ojWd9OGzFZI+rpdEfCEWz X-Received: by 10.99.107.201 with SMTP id g192mr28623527pgc.295.1517480770518; Thu, 01 Feb 2018 02:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517480770; cv=none; d=google.com; s=arc-20160816; b=XTRb0CrTzdU5xZNlu3e6het0nrU5pxDU370hTzEC3pXOZcoB2oWALsNP0L3PKGoAru 7+py9BTHydDWUiJMvjFYvZ527zCYcH0f6Eo7wzMHZVrUiwQcZzlqwrUNvhHZZq2JUBSu PNAJyMFzQIdaQxtlHRMmNuMSfOot4Oak/p9cgnCqyvLAj3/36727No0vtVv6gc4B7Rfc 8IbzwOQdzS5qrhSfZZfDQgKz0ILtLLf1zqHUWVPO/qDd9F1Ewkl5jVA2DV3UA5afVVbY xyhxjNroAGKnytLmGzvYwMChJw+KMLw9hdq6Ss/YVNHDzDYCUF8Tqs95BdATcoIdokk6 vTWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=ljhQ+uul/+EhC13VzjVIcdixXDqpKp8LTfNIoInP/w0=; b=Uo76BhB9hMMQRSgp/gZR0/M6wBwG9cF0VZvWZDnWAZDSpjRGPplYDStBfFrwwIGq39 wEYOAHsxXbtPSjQ8jxx2UA0+30GgC8MUwqvt4TxOGmmptK0qdvH6gwg2Mi9x82YfGXkh s3oUpw2kJnV1NX1TW4MsBY8UGdS4zr1fbb7Tky9Nbb8RCGExEXA+GNDTcLbHPt42wM2y yyFpnwO5LAH0k8u6+heATPZjSBwVzxo5ZrZKUCQz8F1iw1BX3xOW5Wzgqzb6B18t2a32 qox8vym4fI4iHN1tmlNsVYiynpRzDdYTNJlf3ZBBIeKpyRO/5cZcP+KWVb9KZk2UqSy9 A4iw== 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 o184si3330478pga.818.2018.02.01.02.25.56; Thu, 01 Feb 2018 02:26:10 -0800 (PST) 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 S1752068AbeBAKZb (ORCPT + 99 others); Thu, 1 Feb 2018 05:25:31 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:37586 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbeBAKZa (ORCPT ); Thu, 1 Feb 2018 05:25:30 -0500 Received: from ayla.of.borg ([84.194.104.20]) by andre.telenet-ops.be with bizsmtp id 5NRV1x00B0SRDqC01NRVx9; Thu, 01 Feb 2018 11:25:29 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1ehC3d-0007iY-3A; Thu, 01 Feb 2018 11:25:29 +0100 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1ehC3d-0001Sh-2B; Thu, 01 Feb 2018 11:25:29 +0100 From: Geert Uytterhoeven To: Nikolay Aleksandrov , "David S . Miller" , Stephen Hemminger Cc: Arnd Bergmann , bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] net: bridge: Fix uninitialized error in br_fdb_sync_static() Date: Thu, 1 Feb 2018 11:25:27 +0100 Message-Id: <1517480728-5580-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With gcc-4.1.2.: net/bridge/br_fdb.c: In function ‘br_fdb_sync_static’: net/bridge/br_fdb.c:996: warning: ‘err’ may be used uninitialized in this function Indeed, if the list is empty, err will be uninitialized, and will be propagated up as the function return value. Fix this by preinitializing err to zero. Fixes: eb7935830d00b9e0 ("net: bridge: use rhashtable for fdbs") Signed-off-by: Geert Uytterhoeven --- net/bridge/br_fdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index dc87fbc9a23b04e6..d9e69e4514beb20d 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -993,7 +993,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], int br_fdb_sync_static(struct net_bridge *br, struct net_bridge_port *p) { struct net_bridge_fdb_entry *f, *tmp; - int err; + int err = 0; ASSERT_RTNL(); -- 2.7.4