From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 66690AD27 for ; Mon, 14 Aug 2023 10:11:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E438C433C8; Mon, 14 Aug 2023 10:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692007877; bh=uxvanIIHvhdIZvWa0ZURaB6hMyqkNSdzk1Vwl2Ugphk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qbwq5yrZW58GOvlUw/BEWbHlCWfcT5bSz/K4lOpXdVNzecfQ1TjWO7eWfaK/a6Ko8 C6TK62g5tFHU6tm9GLmgV9gWdFWWIFXJFnRRrANz+JoNl5PYgr3EdIbUPxuloHWDQr ny6vjPD5pOV06y0rdEuXpIuIvLxtcjwR55I2rpmZ5d1InZNA71fuQbWt58g3H6LWbb i6hU2zZo6EvS7dtz//YL4eBCuiJvp8Kp9cNF7b4U+GYsXDwkg1R4/2E28bDNGvoepn j3cAobipHAU5tqKc92ahHHngTC8yUbmoHDLoJV1sO9DGUShpNEllYyEVF9hKiSrFYv 6MpJMjG6Uj+qQ== Date: Mon, 14 Aug 2023 13:11:13 +0300 From: Leon Romanovsky To: Li Zetao Cc: vadim.fedorenko@linux.dev, davem@davemloft.net, edumazet@google.com, elic@nvidia.com, kuba@kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, netdev@vger.kernel.org, pabeni@redhat.com, roid@nvidia.com, saeedm@nvidia.com, shayd@nvidia.com, vladbu@nvidia.com, kernel test robot , Dan Carpenter Subject: Re: [PATCH -next v2] net/mlx5: Devcom, only use devcom after NULL check in mlx5_devcom_send_event() Message-ID: <20230814101113.GE3921@unreal> References: <20230814072342.189470-1-lizetao1@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230814072342.189470-1-lizetao1@huawei.com> On Mon, Aug 14, 2023 at 03:23:42PM +0800, Li Zetao wrote: > There is a warning reported by kernel test robot: > > smatch warnings: > drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c:264 > mlx5_devcom_send_event() warn: variable dereferenced before > IS_ERR check devcom (see line 259) > > The reason for the warning is that the pointer is used before check, put > the assignment to comp after devcom check to silence the warning. > > Fixes: 88d162b47981 ("net/mlx5: Devcom, Infrastructure changes") > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/r/202308041028.AkXYDwJ6-lkp@intel.com/ > Signed-off-by: Li Zetao > --- > v1 -> v2: Modify the order of variable declarations to end up with reverse x-mas tree order. > v1: https://lore.kernel.org/all/20230804092636.91357-1-lizetao1@huawei.com/ > > drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky