1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 19:18:07 +02:00

p54: fix a null pointer dereference bug

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25775 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2011-02-27 20:50:45 +00:00
parent a3399057b0
commit 51a59f0c51

View File

@ -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;