diff options
author | Johannes Berg <johannes.berg@intel.com> | 2023-06-14 12:41:26 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-06-19 12:05:25 +0200 |
commit | df6791e74fe7baafe3c9ec1eabfd45a5b0b62595 (patch) | |
tree | 7de99d8b5826042b7e8f2ac3207fe24e5a481c87 /drivers/net/wireless/intel/iwlwifi/mvm/tx.c | |
parent | wifi: iwlwifi: mvm: add a NULL pointer check (diff) | |
download | wireguard-linux-df6791e74fe7baafe3c9ec1eabfd45a5b0b62595.tar.xz wireguard-linux-df6791e74fe7baafe3c9ec1eabfd45a5b0b62595.zip |
wifi: iwlwifi: mvm: check link during TX
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 <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230614123446.cee48479deec.I4eef58f7b67afafb7b3294adbeb6e0067b68419d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tx.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index c0001ee3d9fd..6f34208a6307 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 */ @@ -757,6 +757,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; |