iwlwifi: mvm: check if vif is NULL before using it
authorSharon Dvir <sharon.dvir@intel.com>
Mon, 25 Jul 2016 13:11:05 +0000 (16:11 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 29 Aug 2016 19:29:04 +0000 (22:29 +0300)
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>
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index b4fc86d..6a615bb 100644 (file)
@@ -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;
 }