Skip to contentSkip to conversation

aic94xx: Fix incorrect memory allocation size

PATCH In review [email protected] 2 participants 2 messages Sep 7, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aic94xx: Fix incorrect memory allocation size

This patch corrects the size passed to kmalloc in asd_register_sas_ha()

drivers/scsi/aic94xx/aic94xx_init.c +2 -2
diff -r 134012c83658 drivers/scsi/aic94xx/aic94xx_init.c
@@ -481,9 +481,9 @@ static int asd_register_sas_ha(struct as
 {
 	int i;
 	struct asd_sas_phy   **sas_phys =
-		kmalloc(ASD_MAX_PHYS * sizeof(struct asd_sas_phy), GFP_KERNEL);
+		kmalloc(ASD_MAX_PHYS * sizeof(struct asd_sas_phy *), GFP_KERNEL);
 	struct asd_sas_port  **sas_ports =
-		kmalloc(ASD_MAX_PHYS * sizeof(struct asd_sas_port), GFP_KERNEL);
+		kmalloc(ASD_MAX_PHYS * sizeof(struct asd_sas_port *), GFP_KERNEL);
 
 	if (!sas_phys || !sas_ports) {
 		kfree(sas_phys);
#1 lore raw
Quoted 1 line · On Thu, 2006-09-07 at 11:39 -0700, [email protected] wrote:

This patch corrects the size passed to kmalloc in asd_register_sas_ha()

Actually, could you fix this properly? It should be in the scsi host structure or something related so its lifetime is that of the SCSI host, then we don't need to worry about tracking it. The kmalloc was only a first approximation hack to get the driver to work with multiple controllers.

Thanks,

James