From: andrea merello Date: Sun, 19 Jan 2014 21:21:49 +0000 (+0100) Subject: mac80211: add check on hw->max_signal value on ieee80211_register_hw X-Git-Tag: v3.15-rc1~113^2~289^2^2~101^2~45 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52512072738c851896c8bfa31938eba1e9b9bc62;p=pandora-kernel.git mac80211: add check on hw->max_signal value on ieee80211_register_hw When IEEE80211_HW_SIGNAL_UNSPEC is set, mac80211 will perform a division by max_signal in ieee80211_bss_info_update. If max_signal is not properly set by the driver (for example it is zero) this leads to a divide error and crash. Thanks to Larry Finger, who pointed me to this. This patch adds in ieee80211_register_hw one more check to detect this condition and eventually returns -EINVAL, as already done for other checks already performed there. Signed-off-by: andrea merello [move to an already existing SIGNAL_UNSPEC check] Signed-off-by: Johannes Berg --- Reading git-diff-tree failed