Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp249993rwl; Thu, 23 Mar 2023 15:45:58 -0700 (PDT) X-Google-Smtp-Source: AKy350aj7atMfc/yKp+BgdIQIWbQuT1d+McrsHJ+yF+p2IAzRTm15FP1YtWKeaKEyQlz+tE11KGQ X-Received: by 2002:aa7:cb16:0:b0:4fb:d620:bd27 with SMTP id s22-20020aa7cb16000000b004fbd620bd27mr920052edt.23.1679611558398; Thu, 23 Mar 2023 15:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679611558; cv=none; d=google.com; s=arc-20160816; b=vFmQUFR/ij/04CaGotGMVNDjcCLC93JREqOza0XWxKko5f4gibA0OVPlQVKoMY3U8+ tawYyJ5FiOavQMBxRDgSPyo8Mcjz+31mfNZIee9TCPHlY3AjPZKZguWoJSH7CQviD0nS ZVa9G4p2wpDNB9QYCXVBUkDTq5KRGSQlIAzR3cDbmABApCj013Q9FlwAqeSKlgPLps63 9lSC7wQ+b3YoSwugehhUv+uyGlC0G+2RB2UJXa2TmXh1gY7fqpxNEuP4xkhD6vdHqVst yxFdbGzgPFjeCPuEw0PPXpWilbd5ObxdiOViPB22SHjVZquUGC8xftBQOljjOaxuJsz1 k1KQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=IARxnba+AKDL+c0frywn/sLZW4NWsZ02/pK5LYl85JU=; b=niQvd9OUHPbF1ZWQdXbuieH6fP3xor6n38ar33KWa07C1TFncljzBRfUnDNtc8l0oJ dRvbz03Nh4smhoSNwrCKyW6UyP6Obn/l399ghO5c9NWt1/dkYLeYuOYJ4OArPscpEbHW HihQdFjyJTxf4A/geFAyvJp3sQI4ihE0vml60XJ7gbOI7cW5KtGDVHLQxAoHh1OicBkV sDpB4j6aUTGlJruY88/O4GqzxKCL/M1bbwMZCq4uuJb4yLN7lsegNuXFbPw/ZSpmwfA1 7A+p63plcBwBvlKUzZhNg6/kRmzNfB2XORzsncmmzV+H5UwFPvSZC1CFCvy3TflMFwxO 1J1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Uq1AVvkY; 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 f17-20020a50ee91000000b004c0b7e61b21si20455119edr.365.2023.03.23.15.45.38; Thu, 23 Mar 2023 15:45:58 -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=Uq1AVvkY; 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 S229600AbjCWWgR (ORCPT + 59 others); Thu, 23 Mar 2023 18:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjCWWgQ (ORCPT ); Thu, 23 Mar 2023 18:36:16 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7308B23C4E for ; Thu, 23 Mar 2023 15:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679610975; x=1711146975; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2oXdXzWSKt+wAtNnaZIxsdC9BCMOg4z881auNrA9jzg=; b=Uq1AVvkYRX90QI6670K1FKJn0a0XQkIrOsjvnhYR5jmUuvRf8nrwDC7s mQLc5wlOLP6rX8nQWTRfMlxfNwrEjrbiDBJmpR84hwhJ8aF4FtKzSX3ld VnY62qJIk4DaOqSzLDwUV2PXhVBQFJplM1mjIGeGHX+RL8n4OHbPFQSFa Fx01wYj4tq3OKUH/pSCXpwmQrmIzeICD8GXTui3skAQI7JfH4McN6UGxU HYU+MhC76eO6Ssdjm1Ib25I0rtVK064S5e7JlfoHpog8cnfd+bkwPROBs R78XtMDB1o65rDm1nLQAxBen1C3zmdm3LJt+Rdv1QFrJpXJjgWf0wVMuG g==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="323506037" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="323506037" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 15:36:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="751664845" X-IronPort-AV: E=Sophos;i="5.98,286,1673942400"; d="scan'208";a="751664845" Received: from teshkol-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.249.86.22]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 15:36:13 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Gregory Greenman , Dan Carpenter Subject: [PATCH] wifi: iwlwifi: mvm: fix NULL deref in iwl_mvm_mld_disable_txq Date: Fri, 24 Mar 2023 00:35:43 +0200 Message-Id: <20230323223543.1903872-1-gregory.greenman@intel.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: Gregory Greenman Handle NULL sta pointer. Fixes: 006c152ac9e5 ("wifi: iwlwifi: mvm: add support for the new STA related commands") Reported-by: Dan Carpenter Link: https://lore.kernel.org/linux-wireless/20230314194113.132873ce015c.I7b12a77e5be066730762e6ceeeaa7190293c3df1@changeid/ Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index d81fc9207ef0..51532b6379e2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -227,10 +227,15 @@ static int iwl_mvm_mld_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, u16 *queueptr, u8 tid) { - struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_mvm_sta *mvmsta; int queue = *queueptr; int ret = 0; + if (!sta) + return -EINVAL; + + mvmsta = iwl_mvm_sta_from_mac80211(sta); + if (mvm->sta_remove_requires_queue_remove) { u32 cmd_id = WIDE_ID(DATA_PATH_GROUP, SCD_QUEUE_CONFIG_CMD); -- 2.38.1