diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-20 17:49:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:03 -0500 |
commit | a749716ecc85743f04f7117e3b373266b63edf7e (patch) | |
tree | 1ac30ffbb2bdddb84cae0a4acb510f5ba1829b53 /drivers/net/wireless/airo.c | |
parent | 56d81bd3c76f3ac917a560c662a696aa5e29b980 (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/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index e139a18c6acd..306a1d1c1c22 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -713,7 +713,7 @@ typedef struct { | |||
713 | 713 | ||
714 | 714 | ||
715 | typedef struct { | 715 | typedef struct { |
716 | u16 len; | 716 | __le16 len; |
717 | u8 ap[4][ETH_ALEN]; | 717 | u8 ap[4][ETH_ALEN]; |
718 | } APListRid; | 718 | } APListRid; |
719 | 719 | ||
@@ -1866,16 +1866,15 @@ static int readStatusRid(struct airo_info*ai, StatusRid *statr, int lock) { | |||
1866 | statr->assocStatus = le16_to_cpu(statr->assocStatus); | 1866 | statr->assocStatus = le16_to_cpu(statr->assocStatus); |
1867 | return rc; | 1867 | return rc; |
1868 | } | 1868 | } |
1869 | static int readAPListRid(struct airo_info*ai, APListRid *aplr) { | 1869 | |
1870 | int rc = PC4500_readrid(ai, RID_APLIST, aplr, sizeof(*aplr), 1); | 1870 | static int readAPListRid(struct airo_info *ai, APListRid *aplr) |
1871 | aplr->len = le16_to_cpu(aplr->len); | 1871 | { |
1872 | return rc; | 1872 | return PC4500_readrid(ai, RID_APLIST, aplr, sizeof(*aplr), 1); |
1873 | } | 1873 | } |
1874 | static int writeAPListRid(struct airo_info*ai, APListRid *aplr, int lock) { | 1874 | |
1875 | int rc; | 1875 | static int writeAPListRid(struct airo_info *ai, APListRid *aplr, int lock) |
1876 | aplr->len = cpu_to_le16(aplr->len); | 1876 | { |
1877 | rc = PC4500_writerid(ai, RID_APLIST, aplr, sizeof(*aplr), lock); | 1877 | return PC4500_writerid(ai, RID_APLIST, aplr, sizeof(*aplr), lock); |
1878 | return rc; | ||
1879 | } | 1878 | } |
1880 | 1879 | ||
1881 | static int readCapabilityRid(struct airo_info *ai, CapabilityRid *capr, int lock) | 1880 | 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 ) { | |||
5145 | if ( !data->writelen ) return; | 5144 | if ( !data->writelen ) return; |
5146 | 5145 | ||
5147 | memset( &APList_rid, 0, sizeof(APList_rid) ); | 5146 | memset( &APList_rid, 0, sizeof(APList_rid) ); |
5148 | APList_rid.len = sizeof(APList_rid); | 5147 | APList_rid.len = cpu_to_le16(sizeof(APList_rid)); |
5149 | 5148 | ||
5150 | for( i = 0; i < 4 && data->writelen >= (i+1)*6*3; i++ ) { | 5149 | for( i = 0; i < 4 && data->writelen >= (i+1)*6*3; i++ ) { |
5151 | int j; | 5150 | int j; |
@@ -5943,7 +5942,7 @@ static int airo_set_wap(struct net_device *dev, | |||
5943 | up(&local->sem); | 5942 | up(&local->sem); |
5944 | } else { | 5943 | } else { |
5945 | memset(&APList_rid, 0, sizeof(APList_rid)); | 5944 | memset(&APList_rid, 0, sizeof(APList_rid)); |
5946 | APList_rid.len = sizeof(APList_rid); | 5945 | APList_rid.len = cpu_to_le16(sizeof(APList_rid)); |
5947 | memcpy(APList_rid.ap[0], awrq->sa_data, ETH_ALEN); | 5946 | memcpy(APList_rid.ap[0], awrq->sa_data, ETH_ALEN); |
5948 | disable_MAC(local, 1); | 5947 | disable_MAC(local, 1); |
5949 | writeAPListRid(local, &APList_rid, 1); | 5948 | writeAPListRid(local, &APList_rid, 1); |