Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp342481pxa; Wed, 5 Aug 2020 02:34:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb/hv5QBrAyXiMFFswWTGwmFN2G8DObF/HJ06RpUnAQ3tDnOOPPMDSCjPSuy80l7gL85IR X-Received: by 2002:a17:907:208e:: with SMTP id pv14mr2462353ejb.438.1596620075102; Wed, 05 Aug 2020 02:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596620075; cv=none; d=google.com; s=arc-20160816; b=I30+g3PGmDD+6FlJFot5zLzGbSu2XlsygOEhrZwKZK/TgJk5yyil3OmEOGTlPgYNhv /VFJujUdVobjC1gqdulGvW7+Pq/rbUapsa8cxDAhuqnChhmcGNSxFkYaaf2dO2phYSTJ nlraNChw6iDxzyi/HXUsbbn0+c3W0JRUppo7H7+AWvNUSi0nIWoaEeSqVVZV6PAt2aAS c77+Jw36mAX2RClVV9bm+mHLAn4FgHPFCS58bxBVDP/v40Vtgh/Ds08hdcVPC8QPrqrS mdd6G27/bSlxRJl2nht4BUJTBoRR0QoxYw8eS8ZXq2rGrPSVRpsBcSHKH6R0gdvHPq2u RfLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=Eo8peQlLnPjOUnbR8IFj/Qs1mD6cRBHFgCR+LOGMc/Y=; b=vBVKFhf9c3Oe/y/OStptB5BonI67ePtoHXteBaHalZhQDfgyZFQfW8TNikE5RFd6eA kM6waxV3WMp4wUhMAf7qRFipdscJb0JQ1IywC0gMfraaK4Aws0+/46m7HjdwgtJu042k AwTulE7aS1tDW5cwIZyxPlmwgML4/TKffPoCxxfThCo8w/dzFpjIp6XzCoxtSm+JNTfz mNkal/VkItsEg8y2HWJTx+4jEJQVKlBG4ZUosCrLL5Zc4bERefsgGaA7wbTcc8UqniOX uayqqC49Fo3RJtj2I6UDhNiFU9zSGvpbCuFSoe9Snjp9AGHc7xv3g4ZysbY9RkPg+UoM W7dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=TFhU7f2P; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z20si927619edq.490.2020.08.05.02.34.00; Wed, 05 Aug 2020 02:34:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=TFhU7f2P; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727808AbgHEJdj (ORCPT + 99 others); Wed, 5 Aug 2020 05:33:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbgHEJcj (ORCPT ); Wed, 5 Aug 2020 05:32:39 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46E7C06174A for ; Wed, 5 Aug 2020 02:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Eo8peQlLnPjOUnbR8IFj/Qs1mD6cRBHFgCR+LOGMc/Y=; b=TFhU7f2PQf2Z9ukoLYQBzqfPlJ sMgsVIJFCtHhPlIgedMkvG6NzCGvraF1i3GDuBxb0jHjcy1GvRBEgidv15FRFaBK3qj8hW7+aSKRq JWFeHyDLt3+0y9aOGRa23yskz6BVCc7M47J8vfsT/pLibCUPOMxnbwnVQ2H2ICkH4kLo=; Received: from p54ae996c.dip0.t-ipconnect.de ([84.174.153.108] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1k3Fmn-0008Si-AC for linux-wireless@vger.kernel.org; Wed, 05 Aug 2020 11:32:37 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/2] mt76: mt7915: fix crash on tx rate report for invalid stations Date: Wed, 5 Aug 2020 11:32:34 +0200 Message-Id: <20200805093235.52506-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Check wcid RCU pointer before using it Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 01fa9ca31d0e..949a387e8f93 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -522,6 +522,9 @@ mt7915_mcu_tx_rate_report(struct mt7915_dev *dev, struct sk_buff *skb) return; wcid = rcu_dereference(dev->mt76.wcid[wcidx]); + if (!wcid) + return; + msta = container_of(wcid, struct mt7915_sta, wcid); stats = &msta->stats; -- 2.24.0