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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 709F6C001DF for ; Wed, 2 Aug 2023 07:49:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id ED63681FA2; Wed, 2 Aug 2023 07:49:01 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org ED63681FA2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1690962542; bh=k4JBznYcrw7RV1t5dDx9Cq6R7aqrDwI7rQJP/yRYoSw=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=HiZB4MR27A+WNuKoY6Gk1t51WbXxOmbPjgsMoO8rQRzdQ5e72vRHhfZrLtjwU2BKV AJWiqLwQY+53CdCQ6FL1rWtdrk23oeUHhejOuwWuehw8MXKWA1/6pqj+LSkWIxApWB x5CV4L5XnXQ/bG9WXntIx26DI4A0SdQYuDwxcJ7lIUtsYt7nD+AoM2ZKEHFM0nHifR M6UMcnYpDhPteAynU0WxG0GLDypLG3cjiyveZoWNYE+VZgwDtGj7RaxJ2Jrz0/Vwrf /7Ql50MBPYpDivXVhvL+kL9FjE5VYu5zYRX0jHAXX+sEl8Df28m6k4JD9/Svdjeg7o x7o/jetgfQ0Ig== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NpgXMuhNjCl1; Wed, 2 Aug 2023 07:49:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 05FD881FE4; Wed, 2 Aug 2023 07:49:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 05FD881FE4 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4516D1BF360 for ; Wed, 2 Aug 2023 07:48:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C5E7561139 for ; Wed, 2 Aug 2023 07:48:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C5E7561139 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mlKpVorGoaMA for ; Wed, 2 Aug 2023 07:48:44 +0000 (UTC) Received: from mgamail.intel.com (unknown [134.134.136.24]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8D54260B0C for ; Wed, 2 Aug 2023 07:48:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8D54260B0C X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="372242016" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="372242016" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 00:48:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="843038821" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="843038821" Received: from amlin-019-225.igk.intel.com ([10.102.19.225]) by fmsmga002.fm.intel.com with ESMTP; 02 Aug 2023 00:48:42 -0700 From: Andrii Staikov To: intel-wired-lan@lists.osuosl.org Date: Wed, 2 Aug 2023 09:48:40 +0200 Message-Id: <20230802074840.3650208-1-andrii.staikov@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690962524; x=1722498524; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=eIAd+/bA3LxQCHH/dusMNgdX9qic97iYGuywDxBjBe0=; b=FwBXMza37uPSVXxCRDEIdtbHwz9k4rL3xJojX/G1dYJ1/FgMRTOHlTpq CheD1YbF2l7NlvSKNdwM8EbYhrx1akMMNrBdESkv062k1EavapvyJsDtA lUUxni2L+Pl9RZkKyZVZGK2lTnmW+EOlRU1gNaCzfpGiSAF+FXx6EV0vi 85X8TUlcdu/X2GgiEHvjT+QKBczQWB08vT/dLSs16ev5ajqi/RfhuuVvK Xu49rA3gjiwko3Ov437/YSErvWBeKr3e/jxS3HODeBbxN/mtoqe52Acx/ xQwPT7El9BaLLWGquYG1QcKOXwlwDRnNTZL5Mgd9iyEogGmkd2Ouej8Z/ w==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FwBXMza3 Subject: [Intel-wired-lan] [PATCH iwl-net v1] i40e: fix potential calltrace i40e_sync_vsi_filters() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandr Loktionov , Andrii Staikov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Add defensive check for pf->vf != NULL before referencing pf->vf[]. Fixes: c87c938f62d8 ("i40e: Add VF VLAN pruning") Signed-off-by: Aleksandr Loktionov Signed-off-by: Andrii Staikov --- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 29ad1797adce..a86bfa3bba74 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -2609,7 +2609,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) retval = i40e_correct_mac_vlan_filters (vsi, &tmp_add_list, &tmp_del_list, vlan_filters); - else + else if (pf->vf) retval = i40e_correct_vf_mac_vlan_filters (vsi, &tmp_add_list, &tmp_del_list, vlan_filters, pf->vf[vsi->vf_id].trusted); @@ -2782,7 +2782,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) } /* if the VF is not trusted do not do promisc */ - if ((vsi->type == I40E_VSI_SRIOV) && !pf->vf[vsi->vf_id].trusted) { + if (vsi->type == I40E_VSI_SRIOV && pf->vf && + !pf->vf[vsi->vf_id].trusted) { clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state); goto out; } -- 2.25.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan