aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_mbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_mbox.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index c46685a03a9f..c6a53dccc16a 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -454,7 +454,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
454 pci_set_master(pdev); 454 pci_set_master(pdev);
455 455
456 // Allocate the per driver initialization structure 456 // Allocate the per driver initialization structure
457 adapter = kmalloc(sizeof(adapter_t), GFP_KERNEL); 457 adapter = kzalloc(sizeof(adapter_t), GFP_KERNEL);
458 458
459 if (adapter == NULL) { 459 if (adapter == NULL) {
460 con_log(CL_ANN, (KERN_WARNING 460 con_log(CL_ANN, (KERN_WARNING
@@ -462,7 +462,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
462 462
463 goto out_probe_one; 463 goto out_probe_one;
464 } 464 }
465 memset(adapter, 0, sizeof(adapter_t));
466 465
467 466
468 // set up PCI related soft state and other pre-known parameters 467 // set up PCI related soft state and other pre-known parameters
@@ -746,10 +745,9 @@ megaraid_init_mbox(adapter_t *adapter)
746 * Allocate and initialize the init data structure for mailbox 745 * Allocate and initialize the init data structure for mailbox
747 * controllers 746 * controllers
748 */ 747 */
749 raid_dev = kmalloc(sizeof(mraid_device_t), GFP_KERNEL); 748 raid_dev = kzalloc(sizeof(mraid_device_t), GFP_KERNEL);
750 if (raid_dev == NULL) return -1; 749 if (raid_dev == NULL) return -1;
751 750
752 memset(raid_dev, 0, sizeof(mraid_device_t));
753 751
754 /* 752 /*
755 * Attach the adapter soft state to raid device soft state 753 * Attach the adapter soft state to raid device soft state
@@ -1050,8 +1048,7 @@ megaraid_alloc_cmd_packets(adapter_t *adapter)
1050 * since the calling routine does not yet know the number of available 1048 * since the calling routine does not yet know the number of available
1051 * commands. 1049 * commands.
1052 */ 1050 */
1053 adapter->kscb_list = kmalloc(sizeof(scb_t) * MBOX_MAX_SCSI_CMDS, 1051 adapter->kscb_list = kcalloc(MBOX_MAX_SCSI_CMDS, sizeof(scb_t), GFP_KERNEL);
1054 GFP_KERNEL);
1055 1052
1056 if (adapter->kscb_list == NULL) { 1053 if (adapter->kscb_list == NULL) {
1057 con_log(CL_ANN, (KERN_WARNING 1054 con_log(CL_ANN, (KERN_WARNING
@@ -1059,7 +1056,6 @@ megaraid_alloc_cmd_packets(adapter_t *adapter)
1059 __LINE__)); 1056 __LINE__));
1060 goto out_free_ibuf; 1057 goto out_free_ibuf;
1061 } 1058 }
1062 memset(adapter->kscb_list, 0, sizeof(scb_t) * MBOX_MAX_SCSI_CMDS);
1063 1059
1064 // memory allocation for our command packets 1060 // memory allocation for our command packets
1065 if (megaraid_mbox_setup_dma_pools(adapter) != 0) { 1061 if (megaraid_mbox_setup_dma_pools(adapter) != 0) {
@@ -3495,8 +3491,7 @@ megaraid_cmm_register(adapter_t *adapter)
3495 int i; 3491 int i;
3496 3492
3497 // Allocate memory for the base list of scb for management module. 3493 // Allocate memory for the base list of scb for management module.
3498 adapter->uscb_list = kmalloc(sizeof(scb_t) * MBOX_MAX_USER_CMDS, 3494 adapter->uscb_list = kcalloc(MBOX_MAX_USER_CMDS, sizeof(scb_t), GFP_KERNEL);
3499 GFP_KERNEL);
3500 3495
3501 if (adapter->uscb_list == NULL) { 3496 if (adapter->uscb_list == NULL) {
3502 con_log(CL_ANN, (KERN_WARNING 3497 con_log(CL_ANN, (KERN_WARNING
@@ -3504,7 +3499,6 @@ megaraid_cmm_register(adapter_t *adapter)
3504 __LINE__)); 3499 __LINE__));
3505 return -1; 3500 return -1;
3506 } 3501 }
3507 memset(adapter->uscb_list, 0, sizeof(scb_t) * MBOX_MAX_USER_CMDS);
3508 3502
3509 3503
3510 // Initialize the synchronization parameters for resources for 3504 // Initialize the synchronization parameters for resources for