From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 646A02C83 for ; Thu, 28 Oct 2021 05:29:48 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 47F1260E78; Thu, 28 Oct 2021 05:29:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635398987; bh=+uNFoSa6dL/erRiCd93Xr9hihtBPrLwDyPo7XDnmw+Q=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=tJsfSILbfWaVOB9UkWTFXJpR9/oveK8/lnfDMrFrqZSQHJ0Gfu4Yn2f/aGwZABusn scg/ozMR5YZVgYUPHcQZ9nAyO7vX0wEeHzLUnYMHoBpkwRNzKPprZbCEt6fYLpnwaI zYaIzzQ/EspEBspncZGU5wjod+V2faxDCzdk8AFS4g4uXqI9WXsIp+ItITb0UfZsme 5/W6SxBkL3eP3bXkTU5TnE3HqvvsW4SUBg0mJNUoaDW1KMXp9g+snmmiQ7jVpEtjn8 LCJZX3XYGSoMncwsbQA/OTuIOfSMpQAmYTxOSt4pxBVcHxMD27jTBuLKtdVbV1Mspl ulYN5jsumOtEg== Message-ID: <1f893c71400a8193f8e1637b17bc4196c52293cd.camel@kernel.org> Subject: Re: [PATCH net-next] net/mlx5: Add esw assignment back in mlx5e_tc_sample_unoffload() From: Saeed Mahameed To: Nathan Chancellor , Leon Romanovsky , "David S. Miller" , Jakub Kicinski Cc: Nick Desaulniers , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Date: Wed, 27 Oct 2021 22:29:46 -0700 In-Reply-To: <20211027153122.3224673-1-nathan@kernel.org> References: <20211027153122.3224673-1-nathan@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 2021-10-27 at 08:31 -0700, Nathan Chancellor wrote: > Clang warns: > > drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c:635:34: error: > variable 'esw' is uninitialized when used here [-Werror,- > Wuninitialized] >         mlx5_eswitch_del_offloaded_rule(esw, sample_flow->pre_rule, > sample_flow->pre_attr); >                                         ^~~ > drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c:626:26: note: > initialize the variable 'esw' to silence this warning >         struct mlx5_eswitch *esw; >                                 ^ >                                  = NULL > 1 error generated. > > It appears that the assignment should have been shuffled instead of > removed outright like in mlx5e_tc_sample_offload(). Add it back so > there > is no use of esw uninitialized. > > Fixes: a64c5edbd20e ("net/mlx5: Remove unnecessary checks for slow > path flag") > Link: https://github.com/ClangBuiltLinux/linux/issues/1494 > Signed-off-by: Nathan Chancellor Nice catch ! applied to net-next-mlx5,  Thanks !