aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/highlevel.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2005-11-07 06:31:45 -0500
committerJody McIntyre <scjody@modernduck.com>2005-11-07 06:31:45 -0500
commit8551158abc8ef45a7f473a87e69624d05ebfd684 (patch)
tree47cd79c5f5444c7cac812d797764f203207345a7 /drivers/ieee1394/highlevel.c
parent7afa1467761f06bd9649efd66a4a6b3ff9f29a1f (diff)
kmalloc/kzalloc changes:
dv1394, eth1394, ieee1394, ohci1394, pcilynx, raw1394, sbp2c, video1394: - use kzalloc - provide safer size arguments to kmalloc and kzalloc - omit some casts Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
Diffstat (limited to 'drivers/ieee1394/highlevel.c')
-rw-r--r--drivers/ieee1394/highlevel.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
index 997e1bf6297f..734b121a0554 100644
--- a/drivers/ieee1394/highlevel.c
+++ b/drivers/ieee1394/highlevel.c
@@ -101,12 +101,10 @@ void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
101 return NULL; 101 return NULL;
102 } 102 }
103 103
104 hi = kmalloc(sizeof(*hi) + data_size, GFP_ATOMIC); 104 hi = kzalloc(sizeof(*hi) + data_size, GFP_ATOMIC);
105 if (!hi) 105 if (!hi)
106 return NULL; 106 return NULL;
107 107
108 memset(hi, 0, sizeof(*hi) + data_size);
109
110 if (data_size) { 108 if (data_size) {
111 data = hi->data = hi + 1; 109 data = hi->data = hi + 1;
112 hi->size = data_size; 110 hi->size = data_size;
@@ -326,11 +324,9 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
326 return retval; 324 return retval;
327 } 325 }
328 326
329 as = (struct hpsb_address_serve *) 327 as = kmalloc(sizeof(*as), GFP_KERNEL);
330 kmalloc(sizeof(struct hpsb_address_serve), GFP_KERNEL); 328 if (!as)
331 if (as == NULL) {
332 return retval; 329 return retval;
333 }
334 330
335 INIT_LIST_HEAD(&as->host_list); 331 INIT_LIST_HEAD(&as->host_list);
336 INIT_LIST_HEAD(&as->hl_list); 332 INIT_LIST_HEAD(&as->hl_list);
@@ -383,11 +379,9 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
383 return 0; 379 return 0;
384 } 380 }
385 381
386 as = (struct hpsb_address_serve *) 382 as = kmalloc(sizeof(*as), GFP_ATOMIC);
387 kmalloc(sizeof(struct hpsb_address_serve), GFP_ATOMIC); 383 if (!as)
388 if (as == NULL) { 384 return 0;
389 return 0;
390 }
391 385
392 INIT_LIST_HEAD(&as->host_list); 386 INIT_LIST_HEAD(&as->host_list);
393 INIT_LIST_HEAD(&as->hl_list); 387 INIT_LIST_HEAD(&as->hl_list);