Przeglądaj źródła

iwlwifi: mvm: check if vif is NULL before using it

wdev_to_ieee80211_vif() might return NULL.
Check that vif != NULL before dereferencing it.

Signed-off-by: Sharon Dvir <sharon.dvir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Sharon Dvir 9 lat temu
rodzic
commit
bdc98b1371
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

+ 2 - 0
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

@@ -467,6 +467,8 @@ struct iwl_mvm_vif {
 static inline struct iwl_mvm_vif *
 iwl_mvm_vif_from_mac80211(struct ieee80211_vif *vif)
 {
+	if (!vif)
+		return NULL;
 	return (void *)vif->drv_priv;
 }