aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.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/sbp2.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/sbp2.c')
-rw-r--r--drivers/ieee1394/sbp2.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index b871116fa4d1..84875cd5a70d 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -411,14 +411,12 @@ static int sbp2util_create_command_orb_pool(struct scsi_id_instance_data *scsi_i
411 411
412 spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); 412 spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags);
413 for (i = 0; i < orbs; i++) { 413 for (i = 0; i < orbs; i++) {
414 command = (struct sbp2_command_info *) 414 command = kzalloc(sizeof(*command), GFP_ATOMIC);
415 kmalloc(sizeof(struct sbp2_command_info), GFP_ATOMIC);
416 if (!command) { 415 if (!command) {
417 spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, 416 spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock,
418 flags); 417 flags);
419 return -ENOMEM; 418 return -ENOMEM;
420 } 419 }
421 memset(command, '\0', sizeof(struct sbp2_command_info));
422 command->command_orb_dma = 420 command->command_orb_dma =
423 pci_map_single(hi->host->pdev, &command->command_orb, 421 pci_map_single(hi->host->pdev, &command->command_orb,
424 sizeof(struct sbp2_command_orb), 422 sizeof(struct sbp2_command_orb),
@@ -714,12 +712,11 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
714 712
715 SBP2_DEBUG("sbp2_alloc_device"); 713 SBP2_DEBUG("sbp2_alloc_device");
716 714
717 scsi_id = kmalloc(sizeof(*scsi_id), GFP_KERNEL); 715 scsi_id = kzalloc(sizeof(*scsi_id), GFP_KERNEL);
718 if (!scsi_id) { 716 if (!scsi_id) {
719 SBP2_ERR("failed to create scsi_id"); 717 SBP2_ERR("failed to create scsi_id");
720 goto failed_alloc; 718 goto failed_alloc;
721 } 719 }
722 memset(scsi_id, 0, sizeof(*scsi_id));
723 720
724 scsi_id->ne = ud->ne; 721 scsi_id->ne = ud->ne;
725 scsi_id->ud = ud; 722 scsi_id->ud = ud;