aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-12-11 15:18:26 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:28:06 -0500
commit8084b372adac9c24ff7abdd939b2e8816e7b88a3 (patch)
treea4a4005d7b025abc0a3e7693404abd0abbfd434b /drivers/pcmcia/ds.c
parent6423efaacbf0bce6372897e793d8450c1c08ec8d (diff)
[PATCH] pcmcia: kzalloc conversion
Convert users of kmalloc and memset to kzalloc Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 0fc61dd1d4d0..0252582b91cd 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -264,12 +264,10 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
264 if (fw->size >= CISTPL_MAX_CIS_SIZE) 264 if (fw->size >= CISTPL_MAX_CIS_SIZE)
265 goto release; 265 goto release;
266 266
267 cis = kmalloc(sizeof(cisdump_t), GFP_KERNEL); 267 cis = kzalloc(sizeof(cisdump_t), GFP_KERNEL);
268 if (!cis) 268 if (!cis)
269 goto release; 269 goto release;
270 270
271 memset(cis, 0, sizeof(cisdump_t));
272
273 cis->Length = fw->size + 1; 271 cis->Length = fw->size + 1;
274 memcpy(cis->Data, fw->data, fw->size); 272 memcpy(cis->Data, fw->data, fw->size);
275 273
@@ -387,13 +385,12 @@ static int pcmcia_device_probe(struct device * dev)
387 s->functions = mfc.nfn; 385 s->functions = mfc.nfn;
388 else 386 else
389 s->functions = 1; 387 s->functions = 1;
390 s->config = kmalloc(sizeof(config_t) * s->functions, 388 s->config = kzalloc(sizeof(config_t) * s->functions,
391 GFP_KERNEL); 389 GFP_KERNEL);
392 if (!s->config) { 390 if (!s->config) {
393 ret = -ENOMEM; 391 ret = -ENOMEM;
394 goto put_module; 392 goto put_module;
395 } 393 }
396 memset(s->config, 0, sizeof(config_t) * s->functions);
397 } 394 }
398 395
399 ret = p_drv->probe(p_dev); 396 ret = p_drv->probe(p_dev);
@@ -572,10 +569,9 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
572 if (s->device_count == 2) 569 if (s->device_count == 2)
573 goto err_put; 570 goto err_put;
574 571
575 p_dev = kmalloc(sizeof(struct pcmcia_device), GFP_KERNEL); 572 p_dev = kzalloc(sizeof(struct pcmcia_device), GFP_KERNEL);
576 if (!p_dev) 573 if (!p_dev)
577 goto err_put; 574 goto err_put;
578 memset(p_dev, 0, sizeof(struct pcmcia_device));
579 575
580 p_dev->socket = s; 576 p_dev->socket = s;
581 p_dev->device_no = (s->device_count++); 577 p_dev->device_no = (s->device_count++);