aic94xx: Fix incorrect memory allocation size
PATCH 1/1 aic94xx: Fix incorrect memory allocation size
This patch corrects the size passed to kmalloc in asd_register_sas_ha()
Signed-off-by Malahal Naineni <[email protected]>
drivers/scsi/aic94xx/aic94xx_init.c +2 -2
@@ -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);
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