mac80211: fix crash if bitrate calculation goes wrong
authorJohannes Berg <johannes.berg@intel.com>
Fri, 11 Oct 2013 13:47:06 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Nov 2013 03:05:30 +0000 (12:05 +0900)
commit0b1621f62382e9b6f97b35861e9ade1a979b95b8
tree91019d05487eb7c058b6b0dacd25ba5c44f11ea0
parent31da12cec6d7882acb2bd968566b1cfbbcae695a
mac80211: fix crash if bitrate calculation goes wrong

commit d86aa4f8ca58898ec6a94c0635da20b948171ed7 upstream.

If a frame's timestamp is calculated, and the bitrate
calculation goes wrong and returns zero, the system
will attempt to divide by zero and crash. Catch this
case and print the rate information that the driver
reported when this happens.

Reported-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/util.c