Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2439280rwd; Wed, 14 Jun 2023 02:53:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Q0iLFGTg2kv+WQfqCGyeFf0MKQSn2nK1zVYUSBerB95W28hb5I+6zNnS9bwRdgk+WMNQK X-Received: by 2002:a05:620a:44cd:b0:75e:b8b0:a4b2 with SMTP id y13-20020a05620a44cd00b0075eb8b0a4b2mr18476016qkp.69.1686736425481; Wed, 14 Jun 2023 02:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686736425; cv=none; d=google.com; s=arc-20160816; b=x2iOdjl6BJ15e9yX474MkWDkuLZy943AiHSzLM77u69B2Tvw/RXjwcC/bOH7pC8kUg 1MtNsfA8S9M5ijffvSRgnMGtLKlQD6eOW+Koh/1KgU+VjDecU/eK/RPlh6t+cQelQ4g6 CIBy4Rvll6NMhD9SdvHNhVpFj+lmqPIN98nPFHrmW/c+mpMe+YByuMEyFEk9Yx4A2ta8 b2qtNi7EymuYzmxaep9XPO09K/t4PpAEWUi7etCHhd47bFYlsOC/KfkNX/gs01mqlnwO r6Bmj9hT7euwXa7SxzcHiAcNWFqVQY/laPBuCpakTKPnxs4Tp2mFvN5GgQQk1C7JkWv8 Psvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CcLuiWhR3of9DZsX25+onOJi/tlI+gPUOxxZeXsZ2+k=; b=JTna2QBf5p6+z2th4nKHZkWIN6TK+bzMGKWKEA+A6uPwQU/DD92+/3x6y/WyNtMWkj SJZMMTwA+6/8X043tUfIRRcwmIOX7hCAomyCFLIRJmAFgvqFHeHWSpcDBIgiqxGSMRaR eSxCtBplEPfd3Zf3+0AOg7PNrRDkoYN1Vjig2R4DfMQW8qyhy8Rg9jabJXNCcgzJYC8h ByjUITv0I9gL4o4ZR7eTmtzljX+hlt8HeFBnFRqS8CB+V9VRfuOBJk6l8/+RwXa3v8/i 6RSUlyMPiWKZqKfjAgHP9JL2BjcfVcq8t5/VhtsqnKi//nRDUtBB/0D8eWtfUHGixhax K6tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gY1njajX; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a654389000000b0053ef0ac79c8si8199791pgp.263.2023.06.14.02.53.38; Wed, 14 Jun 2023 02:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gY1njajX; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240888AbjFNJp1 (ORCPT + 61 others); Wed, 14 Jun 2023 05:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244295AbjFNJoq (ORCPT ); Wed, 14 Jun 2023 05:44:46 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C6C1FDD for ; Wed, 14 Jun 2023 02:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686735827; x=1718271827; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+t9IOG/SEHehcfbdbe8npsEo1sjRSjqTZUkR5nHErDU=; b=gY1njajXzqWpWBnnXfcaMTs5Flv0CucF6R7bHMkaw8fuwug8yHxDCjhg zRU9Kt2otOx9JA8enWApmzFu/O79j3eQUbYmlBUZrpBlP/SZLoSKDkcQf KdXYzXcWmE3pl1T5wTth8Ldj+WD5myQoA/SWQBtpRdVAzZFYTwwa3xy1/ YpsEPuhPMiRqy8xOWTpUashY/93yCwFuD5XjcO0ibKVjzOOWAZ6auzpF7 0bdsDgDpAW4jyv9MgmXmZl8nG6l5L9xVH0XXTZe5E7w4RVucSG7EJlpK3 YZrG4I/8klcs2TOXBzfzr2YGAmciS9/9fVTuwOk1l3MjnmI+KyTrcok6r Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="361049855" X-IronPort-AV: E=Sophos;i="6.00,242,1681196400"; d="scan'208";a="361049855" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 02:42:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="711989860" X-IronPort-AV: E=Sophos;i="6.00,242,1681196400"; d="scan'208";a="711989860" Received: from basharil-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.203.45]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2023 02:42:13 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 09/20] wifi: iwlwifi: mvm: check link during TX Date: Wed, 14 Jun 2023 12:41:26 +0300 Message-Id: <20230614123446.cee48479deec.I4eef58f7b67afafb7b3294adbeb6e0067b68419d@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230614094137.379897-1-gregory.greenman@intel.com> References: <20230614094137.379897-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Again, during some (botched) FW restart scenarios we can end up with a NULL link in the driver but mac80211 thinking all is still going OK. If we try to TX at the same time, we can crash there. Fix that by checking for a NULL link during TX. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index bacc3045ea16..06fb4b72ee9b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* - * Copyright (C) 2012-2014, 2018-2022 Intel Corporation + * Copyright (C) 2012-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */ @@ -805,6 +805,8 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb) } link = mvmvif->link[link_id]; + if (WARN_ON(!link)) + return -1; if (!ieee80211_is_data(hdr->frame_control)) sta_id = link->bcast_sta.sta_id; -- 2.38.1