aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo.c
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis@issaris.org>2005-11-07 18:03:15 -0500
committerJohn W. Linville <linville@tuxdriver.com>2005-11-07 21:50:01 -0500
commitb69a3aa85cb7bda2eb6c5932a62c1337d0d6612c (patch)
tree64a65fcec724795c213ab96c1419c95a78c41be4 /drivers/net/wireless/airo.c
parentf36be62115aabd50b4eda0f06f07ab5fae2e9cfd (diff)
[PATCH] wireless net: Conversions of kmalloc/memset to kzalloc
More conversions of kmalloc/memset to kzalloc Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r--drivers/net/wireless/airo.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 849ac88bcccc..58ca585caa59 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4533,9 +4533,8 @@ static int proc_status_open( struct inode *inode, struct file *file ) {
4533 StatusRid status_rid; 4533 StatusRid status_rid;
4534 int i; 4534 int i;
4535 4535
4536 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 4536 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
4537 return -ENOMEM; 4537 return -ENOMEM;
4538 memset(file->private_data, 0, sizeof(struct proc_data));
4539 data = (struct proc_data *)file->private_data; 4538 data = (struct proc_data *)file->private_data;
4540 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { 4539 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
4541 kfree (file->private_data); 4540 kfree (file->private_data);
@@ -4613,9 +4612,8 @@ static int proc_stats_rid_open( struct inode *inode,
4613 int i, j; 4612 int i, j;
4614 u32 *vals = stats.vals; 4613 u32 *vals = stats.vals;
4615 4614
4616 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 4615 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
4617 return -ENOMEM; 4616 return -ENOMEM;
4618 memset(file->private_data, 0, sizeof(struct proc_data));
4619 data = (struct proc_data *)file->private_data; 4617 data = (struct proc_data *)file->private_data;
4620 if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) { 4618 if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) {
4621 kfree (file->private_data); 4619 kfree (file->private_data);
@@ -4879,20 +4877,18 @@ static int proc_config_open( struct inode *inode, struct file *file ) {
4879 struct airo_info *ai = dev->priv; 4877 struct airo_info *ai = dev->priv;
4880 int i; 4878 int i;
4881 4879
4882 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 4880 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
4883 return -ENOMEM; 4881 return -ENOMEM;
4884 memset(file->private_data, 0, sizeof(struct proc_data));
4885 data = (struct proc_data *)file->private_data; 4882 data = (struct proc_data *)file->private_data;
4886 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { 4883 if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
4887 kfree (file->private_data); 4884 kfree (file->private_data);
4888 return -ENOMEM; 4885 return -ENOMEM;
4889 } 4886 }
4890 if ((data->wbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { 4887 if ((data->wbuffer = kzalloc( 2048, GFP_KERNEL )) == NULL) {
4891 kfree (data->rbuffer); 4888 kfree (data->rbuffer);
4892 kfree (file->private_data); 4889 kfree (file->private_data);
4893 return -ENOMEM; 4890 return -ENOMEM;
4894 } 4891 }
4895 memset( data->wbuffer, 0, 2048 );
4896 data->maxwritelen = 2048; 4892 data->maxwritelen = 2048;
4897 data->on_close = proc_config_on_close; 4893 data->on_close = proc_config_on_close;
4898 4894
@@ -5153,24 +5149,21 @@ static int proc_wepkey_open( struct inode *inode, struct file *file ) {
5153 int j=0; 5149 int j=0;
5154 int rc; 5150 int rc;
5155 5151
5156 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5152 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5157 return -ENOMEM; 5153 return -ENOMEM;
5158 memset(file->private_data, 0, sizeof(struct proc_data));
5159 memset(&wkr, 0, sizeof(wkr)); 5154 memset(&wkr, 0, sizeof(wkr));
5160 data = (struct proc_data *)file->private_data; 5155 data = (struct proc_data *)file->private_data;
5161 if ((data->rbuffer = kmalloc( 180, GFP_KERNEL )) == NULL) { 5156 if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) {
5162 kfree (file->private_data); 5157 kfree (file->private_data);
5163 return -ENOMEM; 5158 return -ENOMEM;
5164 } 5159 }
5165 memset(data->rbuffer, 0, 180);
5166 data->writelen = 0; 5160 data->writelen = 0;
5167 data->maxwritelen = 80; 5161 data->maxwritelen = 80;
5168 if ((data->wbuffer = kmalloc( 80, GFP_KERNEL )) == NULL) { 5162 if ((data->wbuffer = kzalloc( 80, GFP_KERNEL )) == NULL) {
5169 kfree (data->rbuffer); 5163 kfree (data->rbuffer);
5170 kfree (file->private_data); 5164 kfree (file->private_data);
5171 return -ENOMEM; 5165 return -ENOMEM;
5172 } 5166 }
5173 memset( data->wbuffer, 0, 80 );
5174 data->on_close = proc_wepkey_on_close; 5167 data->on_close = proc_wepkey_on_close;
5175 5168
5176 ptr = data->rbuffer; 5169 ptr = data->rbuffer;
@@ -5201,9 +5194,8 @@ static int proc_SSID_open( struct inode *inode, struct file *file ) {
5201 char *ptr; 5194 char *ptr;
5202 SsidRid SSID_rid; 5195 SsidRid SSID_rid;
5203 5196
5204 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5197 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5205 return -ENOMEM; 5198 return -ENOMEM;
5206 memset(file->private_data, 0, sizeof(struct proc_data));
5207 data = (struct proc_data *)file->private_data; 5199 data = (struct proc_data *)file->private_data;
5208 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) { 5200 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
5209 kfree (file->private_data); 5201 kfree (file->private_data);
@@ -5211,12 +5203,11 @@ static int proc_SSID_open( struct inode *inode, struct file *file ) {
5211 } 5203 }
5212 data->writelen = 0; 5204 data->writelen = 0;
5213 data->maxwritelen = 33*3; 5205 data->maxwritelen = 33*3;
5214 if ((data->wbuffer = kmalloc( 33*3, GFP_KERNEL )) == NULL) { 5206 if ((data->wbuffer = kzalloc( 33*3, GFP_KERNEL )) == NULL) {
5215 kfree (data->rbuffer); 5207 kfree (data->rbuffer);
5216 kfree (file->private_data); 5208 kfree (file->private_data);
5217 return -ENOMEM; 5209 return -ENOMEM;
5218 } 5210 }
5219 memset( data->wbuffer, 0, 33*3 );
5220 data->on_close = proc_SSID_on_close; 5211 data->on_close = proc_SSID_on_close;
5221 5212
5222 readSsidRid(ai, &SSID_rid); 5213 readSsidRid(ai, &SSID_rid);
@@ -5245,9 +5236,8 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5245 char *ptr; 5236 char *ptr;
5246 APListRid APList_rid; 5237 APListRid APList_rid;
5247 5238
5248 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5239 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5249 return -ENOMEM; 5240 return -ENOMEM;
5250 memset(file->private_data, 0, sizeof(struct proc_data));
5251 data = (struct proc_data *)file->private_data; 5241 data = (struct proc_data *)file->private_data;
5252 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) { 5242 if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
5253 kfree (file->private_data); 5243 kfree (file->private_data);
@@ -5255,12 +5245,11 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5255 } 5245 }
5256 data->writelen = 0; 5246 data->writelen = 0;
5257 data->maxwritelen = 4*6*3; 5247 data->maxwritelen = 4*6*3;
5258 if ((data->wbuffer = kmalloc( data->maxwritelen, GFP_KERNEL )) == NULL) { 5248 if ((data->wbuffer = kzalloc( data->maxwritelen, GFP_KERNEL )) == NULL) {
5259 kfree (data->rbuffer); 5249 kfree (data->rbuffer);
5260 kfree (file->private_data); 5250 kfree (file->private_data);
5261 return -ENOMEM; 5251 return -ENOMEM;
5262 } 5252 }
5263 memset( data->wbuffer, 0, data->maxwritelen );
5264 data->on_close = proc_APList_on_close; 5253 data->on_close = proc_APList_on_close;
5265 5254
5266 readAPListRid(ai, &APList_rid); 5255 readAPListRid(ai, &APList_rid);
@@ -5295,9 +5284,8 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5295 /* If doLoseSync is not 1, we won't do a Lose Sync */ 5284 /* If doLoseSync is not 1, we won't do a Lose Sync */
5296 int doLoseSync = -1; 5285 int doLoseSync = -1;
5297 5286
5298 if ((file->private_data = kmalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5287 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5299 return -ENOMEM; 5288 return -ENOMEM;
5300 memset(file->private_data, 0, sizeof(struct proc_data));
5301 data = (struct proc_data *)file->private_data; 5289 data = (struct proc_data *)file->private_data;
5302 if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) { 5290 if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) {
5303 kfree (file->private_data); 5291 kfree (file->private_data);