Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1691276ybv; Fri, 21 Feb 2020 01:46:57 -0800 (PST) X-Google-Smtp-Source: APXvYqyPiBjHBZACKauUaQ4rzXS9JTOXJw4L6MwcRkkrFVVvW4+FJKJmiRhPDloz8wmi36RJBFIi X-Received: by 2002:aca:c507:: with SMTP id v7mr1241171oif.157.1582278417823; Fri, 21 Feb 2020 01:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582278417; cv=none; d=google.com; s=arc-20160816; b=vDq10ZzPYT2BQRpoIdu7jTzUp15sN5TswKHu9cJsWMjT6cnC7ECqVbjGmqkV7X8YXh SuraeJ33yRtu18mR7RQ2fRCA1h45zf2tN+8PNlSAsZqTsLNgKdVqfsKTXWRlmmbeyDjr dBfGYlr/i8XtDKIS+Xq+F9oWWUEewjyL0R0MPSQ2h3SNvWuw7/S6lCIQeSRJA4UiI9oe znwlRC95wxBOnGatdLDptTvQzDVco4jHToTi0JtGNFFs9fhlI/4qVGgCaBd+w9RAukEV zPX/0wHwpd6pTXZo1kv1FsqreEJV2rrpLfBBBHKlh9ASf983WH8NKC70yRlrniiUFbNa UuZw== 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:cc:to:from; bh=7p0ykpchm7oZzax4lj2W5NSKNeZnc1pEhjhN96hsN7w=; b=wfsM7SRVU62OICngsX0iNIBdpFK3UliCx/kL8Txq0HgA7tRHtLwydJvFXuttC4p1Kg ElPijGM/p8czpOvTsz0qcJwuZQApxwirrVALtwgEjoa1+dA6pyQvy5ZfATqcveY6b2MK e/VCZ/3Ee5brmsKjojmd7VUz5Ys70sfPLD593Lfnf490fMgg3Y6Kh326u+mQsPKcZloH wpAvf87WHbyuRUWj5AYuJk/sI9ZJ964vpsYCJSEGu02RNlwA2t84MlwQhOZjeDYmV/yS 7gWRSH8D/Yv516K7Y5gmPu9KXFH+wqLpXxYgfmNuDGfFZAQ8QaOdCtI8Mi6ttAMmgCdQ yAMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si526005oie.148.2020.02.21.01.46.46; Fri, 21 Feb 2020 01:46:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728075AbgBUJpw (ORCPT + 99 others); Fri, 21 Feb 2020 04:45:52 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:55518 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbgBUJpw (ORCPT ); Fri, 21 Feb 2020 04:45:52 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1j54sY-00Eu34-8m; Fri, 21 Feb 2020 10:45:50 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] mac80211: check vif pointer before airtime calculation Date: Fri, 21 Feb 2020 10:45:45 +0100 Message-Id: <20200221104544.dddb7a3568fd.I0ede2733a3c76e95daeab07538449ea847e7b78d@changeid> X-Mailer: git-send-email 2.24.1 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 From: Johannes Berg In case of monitor mode injection, vif may be NULL, don't crash on that in ieee80211_calc_expected_tx_airtime(). Signed-off-by: Johannes Berg --- net/mac80211/tx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 38f20a370f2a..8dd93072f6e6 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -5,7 +5,7 @@ * Copyright 2006-2007 Jiri Benc * Copyright 2007 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * Transmit and frame generation functions. */ @@ -3682,7 +3682,8 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, encap_out: IEEE80211_SKB_CB(skb)->control.vif = vif; - if (wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) { + if (vif && + wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) { u32 airtime; airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta, -- 2.24.1