linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Praveen Srinivasan <praveens@stanford.edu>
To: linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com, alan@lxorguk.ukuu.org.uk
Subject: [PATCH] megaraid.c
Date: Mon, 11 Jun 2001 23:05:46 -0700	[thread overview]
Message-ID: <200106120605.f5C65f402129@smtp1.Stanford.EDU> (raw)

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

             reply	other threads:[~2001-06-12  6:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-12  6:05 Praveen Srinivasan [this message]
2001-06-12 16:16 ` Alan Cox
2001-06-12 16:17 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200106120605.f5C65f402129@smtp1.Stanford.EDU \
    --to=praveens@stanford.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --subject='Re: [PATCH] megaraid.c' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).