Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79357
b: refs/heads/master
c: 184a3b2
h: refs/heads/master
i:
  79355: 0c50012
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Jan 28, 2008
1 parent d27e04c commit 8f2fb78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 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: 8a9faf3cd08b91aca1502dbe18e3b5063fda2e87
refs/heads/master: 184a3b2c517531faac80b0d74c423dd26038cfd2
14 changes: 6 additions & 8 deletions trunk/drivers/net/wireless/hostap/hostap_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2448,18 +2448,16 @@ static void prism2_info(local_info_t *local)
goto out;
}

le16_to_cpus(&info.len);
le16_to_cpus(&info.type);
left = (info.len - 1) * 2;
left = (le16_to_cpu(info.len) - 1) * 2;

if (info.len & 0x8000 || info.len == 0 || left > 2060) {
if (info.len & cpu_to_le16(0x8000) || info.len == 0 || left > 2060) {
/* data register seems to give 0x8000 in some error cases even
* though busy bit is not set in offset register;
* in addition, length must be at least 1 due to type field */
spin_unlock(&local->baplock);
printk(KERN_DEBUG "%s: Received info frame with invalid "
"length 0x%04x (type 0x%04x)\n", dev->name, info.len,
info.type);
"length 0x%04x (type 0x%04x)\n", dev->name,
le16_to_cpu(info.len), le16_to_cpu(info.type));
goto out;
}

Expand All @@ -2476,8 +2474,8 @@ static void prism2_info(local_info_t *local)
{
spin_unlock(&local->baplock);
printk(KERN_WARNING "%s: Info frame read failed (fid=0x%04x, "
"len=0x%04x, type=0x%04x\n",
dev->name, fid, info.len, info.type);
"len=0x%04x, type=0x%04x\n", dev->name, fid,
le16_to_cpu(info.len), le16_to_cpu(info.type));
dev_kfree_skb(skb);
goto out;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/wireless/hostap/hostap_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb)
buf = skb->data + sizeof(*info);
left = skb->len - sizeof(*info);

switch (info->type) {
switch (le16_to_cpu(info->type)) {
case HFA384X_INFO_COMMTALLIES:
prism2_info_commtallies(local, buf, left);
break;
Expand All @@ -395,7 +395,8 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb)
#ifndef PRISM2_NO_DEBUG
default:
PDEBUG(DEBUG_EXTRA, "%s: INFO - len=%d type=0x%04x\n",
local->dev->name, info->len, info->type);
local->dev->name, le16_to_cpu(info->len),
le16_to_cpu(info->type));
PDEBUG(DEBUG_EXTRA, "Unknown info frame:");
for (i = 0; i < (left < 100 ? left : 100); i++)
PDEBUG2(DEBUG_EXTRA, " %02x", buf[i]);
Expand Down

0 comments on commit 8f2fb78

Please sign in to comment.