Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86914
b: refs/heads/master
c: c2f2d3a
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Mar 4, 2008
1 parent a8c100d commit 3d0ccb5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c28293f5514f64ba064bac7946aebeda4a663c6
refs/heads/master: c2f2d3a06f8b628d444cf4f396d6c6ddd47e1d1f
18 changes: 11 additions & 7 deletions trunk/drivers/net/wireless/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,23 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
struct p54_common *priv = dev->priv;
struct eeprom_pda_wrap *wrap = NULL;
struct pda_entry *entry;
int i = 0;
unsigned int data_len, entry_len;
void *tmp;
int err;
u8 *end = (u8 *)eeprom + len;

wrap = (struct eeprom_pda_wrap *) eeprom;
entry = (void *)wrap->data + le16_to_cpu(wrap->len);
i += 2;
i += le16_to_cpu(entry->len)*2;
while (i < len) {

/* verify that at least the entry length/code fits */
while ((u8 *)entry <= end - sizeof(*entry)) {
entry_len = le16_to_cpu(entry->len);
data_len = ((entry_len - 1) << 1);

/* abort if entry exceeds whole structure */
if ((u8 *)entry + sizeof(*entry) + data_len > end)
break;

switch (le16_to_cpu(entry->code)) {
case PDR_MAC_ADDRESS:
SET_IEEE80211_PERM_ADDR(dev, entry->data);
Expand Down Expand Up @@ -249,13 +254,12 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
priv->version = *(u8 *)(entry->data + 1);
break;
case PDR_END:
i = len;
/* make it overrun */
entry_len = len;
break;
}

entry = (void *)entry + (entry_len + 1)*2;
i += 2;
i += entry_len*2;
}

if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
Expand Down

0 comments on commit 3d0ccb5

Please sign in to comment.