lkml.org 
[lkml]   [2001]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] megaraid.c
Date
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/
\
 
 \ /
  Last update: 2005-03-22 12:55    [from the cache]
©2003-2011 Jasper Spaans