aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-12-20 17:49:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:09:03 -0800
commita749716ecc85743f04f7117e3b373266b63edf7e (patch)
tree1ac30ffbb2bdddb84cae0a4acb510f5ba1829b53 /drivers
parent56d81bd3c76f3ac917a560c662a696aa5e29b980 (diff)
airo: sanitize APListRid handling
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/airo.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index e139a18c6ac..306a1d1c1c2 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -713,7 +713,7 @@ typedef struct {
typedef struct {
- u16 len;
+ __le16 len;
u8 ap[4][ETH_ALEN];
} APListRid;
@@ -1866,16 +1866,15 @@ static int readStatusRid(struct airo_info*ai, StatusRid *statr, int lock) {
statr->assocStatus = le16_to_cpu(statr->assocStatus);
return rc;
}
-static int readAPListRid(struct airo_info*ai, APListRid *aplr) {
- int rc = PC4500_readrid(ai, RID_APLIST, aplr, sizeof(*aplr), 1);
- aplr->len = le16_to_cpu(aplr->len);
- return rc;
+
+static int readAPListRid(struct airo_info *ai, APListRid *aplr)
+{
+ return PC4500_readrid(ai, RID_APLIST, aplr, sizeof(*aplr), 1);
}
-static int writeAPListRid(struct airo_info*ai, APListRid *aplr, int lock) {
- int rc;
- aplr->len = cpu_to_le16(aplr->len);
- rc = PC4500_writerid(ai, RID_APLIST, aplr, sizeof(*aplr), lock);
- return rc;
+
+static int writeAPListRid(struct airo_info *ai, APListRid *aplr, int lock)
+{
+ return PC4500_writerid(ai, RID_APLIST, aplr, sizeof(*aplr), lock);
}
static int readCapabilityRid(struct airo_info *ai, CapabilityRid *capr, int lock)
@@ -5145,7 +5144,7 @@ static void proc_APList_on_close( struct inode *inode, struct file *file ) {
if ( !data->writelen ) return;
memset( &APList_rid, 0, sizeof(APList_rid) );
- APList_rid.len = sizeof(APList_rid);
+ APList_rid.len = cpu_to_le16(sizeof(APList_rid));
for( i = 0; i < 4 && data->writelen >= (i+1)*6*3; i++ ) {
int j;
@@ -5943,7 +5942,7 @@ static int airo_set_wap(struct net_device *dev,
up(&local->sem);
} else {
memset(&APList_rid, 0, sizeof(APList_rid));
- APList_rid.len = sizeof(APList_rid);
+ APList_rid.len = cpu_to_le16(sizeof(APList_rid));
memcpy(APList_rid.ap[0], awrq->sa_data, ETH_ALEN);
disable_MAC(local, 1);
writeAPListRid(local, &APList_rid, 1);