Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp589290imm; Sat, 7 Jul 2018 04:09:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpefcV//abUBJBSwtmyILsysyzwKmMrdopsE81c7shwpcJVWpeCDn7W0KD7DeuBBEMzt43R/ X-Received: by 2002:a65:6252:: with SMTP id q18-v6mr12602870pgv.106.1530961741446; Sat, 07 Jul 2018 04:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530961741; cv=none; d=google.com; s=arc-20160816; b=o1mgQ6fK31Xu4NCgsjw1BuHyf+k89o4nqyHa6Qc8fjSjjTBk0YwlGHLyLZEhaJwR0Y YWj53RFjb4k6UOSFjFYL+4CiFR2bDCh1QD3Pp4LaxbYoSp+qzWQplF1zMfuEFvFY45Z0 zwwICNdXYToiisnra2XkmS6pMoFxyPJ6Klc8erCqtAZHAWXxrvaF2sYc2knzpCLsVARu 5+5EyKKQJsslBwF7isRN/zj94Mfry5PzR75a9An5T9TZKb1heMj67yhGGbjUIMw4kryr EjmqA1bnB7Yh78FFyhpIp/GqcuRghYlQQtj15DbyWBLEvN04HNz5MPS253WM9UVEZ8Yp z6/g== 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 :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=zoj5r9pM/lhYwX8+rf6FwBqQUhMMeHUTrs4u9vfo4vk=; b=vI747zcHzBFSpk7Nsxcp9A6RSDLxE7TcvuHwYEuH2D2cEmenVeH7QqlFj6AfXHVkSg hH6NICN5qWO/hWPJxGZtjBR+YNGlCP+x/t/YcT7Co9voh2jWbC6u8AdgOMD73nWFuiM/ 9ZeewUutXj3eJZD1YUiG1X7ollZ/3lTfTm0Qr9WtCBDTYEgLn3Q1Uj7DIoFQWzKXEnI+ Tg8tnj2gKpWg7kBmdQeGfAh2u2e5DzepYqQIaGG0XWxd7LWkYPHi2CWZVfMH4rMwNV8q lb9/hmIyanzGq2Y7nJl4ThbR66GogSA56KLb2QIHfIzXb1H6vFAB4TdMLPtXWpqbv/fB Fb2A== 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 b17-v6si9998122pgn.308.2018.07.07.04.08.47; Sat, 07 Jul 2018 04:09:01 -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 S1754049AbeGGLHQ (ORCPT + 99 others); Sat, 7 Jul 2018 07:07:16 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:51176 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbeGGLHN (ORCPT ); Sat, 7 Jul 2018 07:07:13 -0400 Received: from localhost (unknown [211.196.191.92]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 8E78211AB72AE; Sat, 7 Jul 2018 04:07:11 -0700 (PDT) Date: Sat, 07 Jul 2018 20:07:09 +0900 (KST) Message-Id: <20180707.200709.254416544610589415.davem@davemloft.net> To: arnd@arndb.de Cc: jiri@mellanox.com, idosch@mellanox.com, petrm@mellanox.com, arkadis@mellanox.com, dsahern@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] mlxsw: spectrum_router: avoid uninitialized variable access From: David Miller In-Reply-To: <20180706124455.3151925-1-arnd@arndb.de> References: <20180706124455.3151925-1-arnd@arndb.de> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 07 Jul 2018 04:07:13 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Date: Fri, 6 Jul 2018 14:44:45 +0200 > When CONFIG_BRIDGE_VLAN_FILTERING is disabled, gcc correctly points out > that the 'vid' variable is uninitialized whenever br_vlan_get_pvid > returns an error: > > drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c: In function 'mlxsw_sp_rif_vlan_fid_get': > drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6881:6: error: 'vid' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > This changes the condition check to always return -EINVAL here, > which I guess is what the author intended here. > > Fixes: e6f1960ae6c7 ("mlxsw: spectrum_router: Allocate FID according to PVID") > Signed-off-by: Arnd Bergmann Applied.