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 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34CB0E9129C for ; Thu, 5 Feb 2026 09:27:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 009BE40D8B; Thu, 5 Feb 2026 09:27:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lRKOBUGWlmlo; Thu, 5 Feb 2026 09:27:21 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CEBF340D75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1770283641; bh=Tcc6PX6QF1vULhCJJzQoWngAFn2ua3JyJScC85lNYGk=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gRpUuxUL/m3BBdMIh+UIMBE6tgj8uQD98T+xvILNsi704luSU6QeVSvziCSiRmqI2 hgyXzrmJKfpOT/SXsfP48Oil/5n7sXZGPhgb+7yt/GEiUg15ug2pjfIGS8O6/RpbnO X99a77gCeMH1YG+ck24cldvHNIxkuUTr9GMU/SO+OyQazW2IlUovA16sxZI3esNEAe NrGtuN9Za8xu6RjAA3CTMUFttGHdKVtK6gX+Jhw/xtYg3Nh+eeOWfeklWP8PJaLwdd ODIr7VJ6GIMNkSlyfoJD3XM4pEVX8wlGxIaxd4dIqJhC3WGpkqONrvuXm7r6gtIvuE tqXc2OvjJSavw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id CEBF340D75; Thu, 5 Feb 2026 09:27:21 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id D3947F5 for ; Thu, 5 Feb 2026 09:27:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BEAD7840EA for ; Thu, 5 Feb 2026 09:27:20 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6Q5_ka52bsiu for ; Thu, 5 Feb 2026 09:27:20 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=49.212.198.91; helo=www2881.sakura.ne.jp; envelope-from=kohei@enjuk.jp; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org CBF0F8333F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CBF0F8333F Received: from www2881.sakura.ne.jp (www2881.sakura.ne.jp [49.212.198.91]) by smtp1.osuosl.org (Postfix) with ESMTPS id CBF0F8333F for ; Thu, 5 Feb 2026 09:27:19 +0000 (UTC) Received: from ms-a2 (182.51.30.125.dy.iij4u.or.jp [125.30.51.182]) (authenticated bits=0) by www2881.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 6159QoOb043991 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Feb 2026 18:26:51 +0900 (JST) (envelope-from kohei@enjuk.jp) From: Kohei Enju To: vitaly.lifshits@intel.com Cc: andrew+netdev@lunn.ch, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, intel-wired-lan@lists.osuosl.org, kohei.enju@gmail.com, kohei@enjuk.jp, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, przemyslaw.kitszel@intel.com Date: Thu, 5 Feb 2026 09:26:50 +0000 Message-ID: <20260205092650.7779-1-kohei@enjuk.jp> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: a=rsa-sha256; bh=Tcc6PX6QF1vULhCJJzQoWngAFn2ua3JyJScC85lNYGk=; c=relaxed/relaxed; d=enjuk.jp; h=From:To:Subject:Date:Message-ID; s=rs20251215; t=1770283612; v=1; b=qh8/qmdci12zQVNAFrKxK7comDby3Q/lv/luuEmIT3bR/AJsjA8e7eudeD7tKKwG WHltoUNz21k/3DWxGR8NKIirMtCSh1ODG/nC3gR4Pd0c859kbWtTs50fGsjPzIHW QzC9Q4l8DyLaxpQDx7KCM4I0vE/e1JraKj1D9GJGMC1gzeVcWSkPk8omQsBcwEqj dhhinzJizti4ftuPwJFwbnzH14nIlnQbVAfCMW7nRfvWqBEL75QPaABZF8qxfKUl 44fBJ4eE+VQgL45S9LrurATe243IaggxT5oB9WnAlTKC8g2K3zoYVZUKwL9pfsv/ oL8pygF4NcXyzoqsSYM+KQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=enjuk.jp X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=enjuk.jp header.i=@enjuk.jp header.a=rsa-sha256 header.s=rs20251215 header.b=qh8/qmdc Subject: Re: [Intel-wired-lan] [PATCH v1 iwl-net] igc: fix null pointer dereference in X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, 5 Feb 2026 11:16:50 +0200, "Lifshits, Vitaly" wrote: > On 2/5/2026 10:50 AM, Kohei Enju wrote: > > On devices without NVM, hw->nvm.ops.validate is set to NULL, therefore > > functions that perform EEPROM-related operations such as > > igc_ethtool_set_eeprom() and igc_probe() check for NVM presence in > > advance. However igc_eeprom_test() unconditionally calls > > hw->nvm.ops.validate(), potentially causing a null pointer dereference. > > > > NVM-less devices may not be common but possible, so add NULL check > > before calling hw->nvm.ops.validate(). > > > > Fixes: f026d8ca2904 ("igc: add support to eeprom, registers and link self-tests") > > Signed-off-by: Kohei Enju > > --- > > drivers/net/ethernet/intel/igc/igc_diag.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/intel/igc/igc_diag.c b/drivers/net/ethernet/intel/igc/igc_diag.c > > index a43d7244ee70..973d26a5a6c9 100644 > > --- a/drivers/net/ethernet/intel/igc/igc_diag.c > > +++ b/drivers/net/ethernet/intel/igc/igc_diag.c > > @@ -158,7 +158,7 @@ bool igc_eeprom_test(struct igc_adapter *adapter, u64 *data) > > > > *data = 0; > > > > - if (hw->nvm.ops.validate(hw) != IGC_SUCCESS) { > > + if (hw->nvm.ops.validate && hw->nvm.ops.validate(hw) != IGC_SUCCESS) { > > *data = 1; > > return false; > > } > > > Hi Kohei, > > Thank you for your patch. > > Since there are no NVM-less devices I suggest removing the flash-less > code entirely from the init flow. Oh, I see there're no NVM-less devices. Then removing sounds good to me. Could you clarify what you mean by "init flow"? Do you mean removing only the flash-less branch in igc_init_nvm_params_i225(), or removing all flash-less related code including igc_get_flash_presence_i225() and its callers? After clarification, I'd love to work on it. Thank you for taking a look!