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>
This commit is contained in:
Stefan Richter
2005-11-07 06:31:45 -05:00
committed by Jody McIntyre
parent 7afa146776
commit 8551158abc
12 changed files with 84 additions and 142 deletions

View File

@ -101,12 +101,10 @@ void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
return NULL;
}
hi = kmalloc(sizeof(*hi) + data_size, GFP_ATOMIC);
hi = kzalloc(sizeof(*hi) + data_size, GFP_ATOMIC);
if (!hi)
return NULL;
memset(hi, 0, sizeof(*hi) + data_size);
if (data_size) {
data = hi->data = hi + 1;
hi->size = data_size;
@ -326,11 +324,9 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
return retval;
}
as = (struct hpsb_address_serve *)
kmalloc(sizeof(struct hpsb_address_serve), GFP_KERNEL);
if (as == NULL) {
as = kmalloc(sizeof(*as), GFP_KERNEL);
if (!as)
return retval;
}
INIT_LIST_HEAD(&as->host_list);
INIT_LIST_HEAD(&as->hl_list);
@ -383,11 +379,9 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host,
return 0;
}
as = (struct hpsb_address_serve *)
kmalloc(sizeof(struct hpsb_address_serve), GFP_ATOMIC);
if (as == NULL) {
return 0;
}
as = kmalloc(sizeof(*as), GFP_ATOMIC);
if (!as)
return 0;
INIT_LIST_HEAD(&as->host_list);
INIT_LIST_HEAD(&as->hl_list);