aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-02-27 20:50:45 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-02-27 20:50:45 +0000
commitba5bfe48c37d7514f43e6b5f33bced3c2fb56cb7 (patch)
tree00b1b6ac462fb502b8b874ee945ff828fd97576f
parentf6bd11e72d8051d2b34b227f63eac0c39777ec8b (diff)
downloadupstream-ba5bfe48c37d7514f43e6b5f33bced3c2fb56cb7.tar.gz
upstream-ba5bfe48c37d7514f43e6b5f33bced3c2fb56cb7.tar.bz2
upstream-ba5bfe48c37d7514f43e6b5f33bced3c2fb56cb7.zip
p54: fix a null pointer dereference bug
SVN-Revision: 25775
-rw-r--r--package/mac80211/patches/710-p54_rssi_crash_fix.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/package/mac80211/patches/710-p54_rssi_crash_fix.patch b/package/mac80211/patches/710-p54_rssi_crash_fix.patch
new file mode 100644
index 0000000000..73089cda55
--- /dev/null
+++ b/package/mac80211/patches/710-p54_rssi_crash_fix.patch
@@ -0,0 +1,18 @@
+--- a/drivers/net/wireless/p54/eeprom.c
++++ b/drivers/net/wireless/p54/eeprom.c
+@@ -524,10 +524,13 @@ err_data:
+
+ struct p54_rssi_db_entry *p54_rssi_find(struct p54_common *priv, const u16 freq)
+ {
+- struct p54_rssi_db_entry *entry = (void *)(priv->rssi_db->data +
+- priv->rssi_db->offset);
++ struct p54_rssi_db_entry *entry;
+ int i, found = -1;
+
++ if (!priv->rssi_db)
++ return &p54_rssi_default;
++
++ entry = (void *)(priv->rssi_db->data + priv->rssi_db->offset);
+ for (i = 0; i < priv->rssi_db->entries; i++) {
+ if (!same_band(freq, entry[i].freq))
+ continue;