From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40AC8C48BCF for ; Wed, 9 Jun 2021 18:07:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 220EB613D7 for ; Wed, 9 Jun 2021 18:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231389AbhFISJe (ORCPT ); Wed, 9 Jun 2021 14:09:34 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:54675 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbhFISJe (ORCPT ); Wed, 9 Jun 2021 14:09:34 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0DED95C0172; Wed, 9 Jun 2021 14:07:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 09 Jun 2021 14:07:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=+57D/J g6bs5+SePgby7diY3f/m6igTC7E5KydLDWcpY=; b=pNhGePw7HHHJ6tkEFRNkb8 EPXbu4ikycdCr4Zn4KzARv/158Eyd1Qpn63cKxqDB48X3TxkPRcdO8xtX3Rq65Ec KcoM8FA0Z59492Raqo3J3g8l4BFWHkLnKxJMe7mYHCDXnbsfw3+ZNESoDJCj++Yv sU1S+T+qTMSUF1ZKWZyJCjphi5fcOgIqcdz20Xjualk1CnZXmA/8okqlb+e9bL7T tTRmDZe+w1xD9K1UQsxo1iP5ymTBh5c10wAtlXv2L6OMlRq109sd6at8tRCcDyGv Vsz/vESWcUTDmxMNIUKyNEVwogSqRBZ2l9mlZv6+tplelXd1Kq5X7TOGZil2YyJA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduuddguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcu ufgthhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrth htvghrnheptdffkeekfeduffevgeeujeffjefhtefgueeugfevtdeiheduueeukefhudeh leetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih guohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Jun 2021 14:07:38 -0400 (EDT) Date: Wed, 9 Jun 2021 21:07:35 +0300 From: Ido Schimmel To: Colin King Cc: Jiri Pirko , Ido Schimmel , "David S . Miller" , Jakub Kicinski , Mykola Kostenok , Vadim Pasternak , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] mlxsw: thermal: Fix null dereference of NULL temperature parameter Message-ID: References: <20210609175657.299112-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210609175657.299112-1-colin.king@canonical.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 06:56:57PM +0100, Colin King wrote: > From: Colin Ian King > > The call to mlxsw_thermal_module_temp_and_thresholds_get passes a NULL > pointer for the temperature and this can be dereferenced in this function > if the mlxsw_reg_query call fails. The simplist fix is to pass the > address of dummy temperature variable instead of a NULL pointer. > > Addresses-Coverity: ("Explicit null dereferenced") > Fixes: 72a64c2fe9d8 ("mlxsw: thermal: Read module temperature thresholds using MTMP register") > Signed-off-by: Colin Ian King Reviewed-by: Ido Schimmel Thanks