drivers/scsi/aic94xx/aic94xx_init.c: correct the size argument to kmalloc
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / scsi / aic94xx / aic94xx_init.c
index 24ac2315c5c7f2becb398500382699a38e63fff0..3b7e83d2dab4f1b491cc35523628e6532ce27fdb 100644 (file)
@@ -688,9 +688,9 @@ static int asd_register_sas_ha(struct asd_ha_struct *asd_ha)
 {
        int i;
        struct asd_sas_phy   **sas_phys =
-               kmalloc(ASD_MAX_PHYS * sizeof(struct asd_sas_phy), GFP_KERNEL);
+               kcalloc(ASD_MAX_PHYS, sizeof(*sas_phys), GFP_KERNEL);
        struct asd_sas_port  **sas_ports =
-               kmalloc(ASD_MAX_PHYS * sizeof(struct asd_sas_port), GFP_KERNEL);
+               kcalloc(ASD_MAX_PHYS, sizeof(*sas_ports), GFP_KERNEL);
 
        if (!sas_phys || !sas_ports) {
                kfree(sas_phys);