public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] aic94xx: Fix incorrect memory allocation size
@ 2006-09-07 18:39 malahal
  2006-09-07 19:38 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: malahal @ 2006-09-07 18:39 UTC (permalink / raw)
  To: linux-scsi

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

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>


diff -r 134012c83658 drivers/scsi/aic94xx/aic94xx_init.c
--- a/drivers/scsi/aic94xx/aic94xx_init.c	Thu Aug 31 13:03:38 2006 -0700
+++ b/drivers/scsi/aic94xx/aic94xx_init.c	Wed Sep 06 23:40:29 2006 -0700
@@ -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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] aic94xx: Fix incorrect memory allocation size
  2006-09-07 18:39 [PATCH] aic94xx: Fix incorrect memory allocation size malahal
@ 2006-09-07 19:38 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2006-09-07 19:38 UTC (permalink / raw)
  To: malahal; +Cc: linux-scsi

On Thu, 2006-09-07 at 11:39 -0700, malahal@us.ibm.com 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-07 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-07 18:39 [PATCH] aic94xx: Fix incorrect memory allocation size malahal
2006-09-07 19:38 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox