wifi: iwlwifi: mvm: check link during TX
[platform/kernel/linux-rpi.git] / drivers / net / wireless / intel / iwlwifi / mvm / tx.c
index c0001ee..6f34208 100644 (file)
@@ -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;