linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] megaraid.c
@ 2001-06-12  6:05 Praveen Srinivasan
  2001-06-12 16:16 ` Alan Cox
  2001-06-12 16:17 ` Alan Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Praveen Srinivasan @ 2001-06-12  6:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, alan

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;
 
                /*

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

end of thread, other threads:[~2001-06-12 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-12  6:05 [PATCH] megaraid.c Praveen Srinivasan
2001-06-12 16:16 ` Alan Cox
2001-06-12 16:17 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).