[PATCH] megaraid.c

Praveen Srinivasan (praveens@stanford.edu)
Mon, 11 Jun 2001 23:05:46 -0700


Hi,
This patch fixes an instance where an allocation is checked, but only after
the pointer is memset() - moving the memset further down in the function
fixes this.

Praveen Srinivasan

--- ../linux-fresh/./drivers/scsi/megaraid.c Fri Apr 27 13:59:18 2001
+++ ./drivers/scsi/megaraid.c Wed May 23 12:31:01 2001
@@ -4115,7 +4115,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) /* 0x020400 */
scsicmd = (Scsi_Cmnd *) kmalloc (sizeof (Scsi_Cmnd),
GFP_KERNEL | GFP_DMA);
- memset (scsicmd, 0, sizeof (Scsi_Cmnd));
+
#else
scsicmd = (Scsi_Cmnd *) scsi_init_malloc (sizeof (Scsi_Cmnd),
GFP_ATOMIC |
GFP_DMA);
@@ -4127,6 +4127,9 @@
return -ENOMEM;
}

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) /* 0x020400 */
+ memset (scsicmd, 0, sizeof (Scsi_Cmnd));
+#endif
scsicmd->host = NULL;

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/