From: Sharon Dvir Date: Mon, 25 Jul 2016 13:11:05 +0000 (+0300) Subject: iwlwifi: mvm: check if vif is NULL before using it X-Git-Tag: v4.8-rc8~24^2~7^2^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdc98b13716eafc454457e068d6c8aaffaaa71e4;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Luca Coelho --- diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index b4fc86d..6a615bb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/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; }