mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Praveen Srinivasan <praveens@stanford.edu>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk, mingo@redhat.com
Subject: [PATCH] md.c - null ptr fixes for 2.4.4
Date: Thu, 24 May 2001 00:33:27 -0700	[thread overview]
Message-ID: <200105240732.f4O7WLH23332@smtp2.Stanford.EDU> (raw)

Hi,
This patch fixes some unchecked ptr bugs in the multiple devices driver 
(RAID) code (md.c).

Praveen Srinivasan and Frederick Akalin

--- ../linux/./drivers/md/md.c	Fri Apr  6 10:42:55 2001
+++ ./drivers/md/md.c	Mon May  7 22:08:02 2001
@@ -3756,6 +3756,7 @@
 			continue;
 		}
 		mddev = alloc_mddev(MKDEV(MD_MAJOR,minor));
+
 		if (md_setup_args.pers[minor]) {
 			/* non-persistent */
 			mdu_array_info_t ainfo;
@@ -3773,7 +3774,12 @@
 			ainfo.spare_disks = 0;
 			ainfo.layout = 0;
 			ainfo.chunk_size = md_setup_args.chunk[minor];
-			err = set_array_info(mddev, &ainfo);
+			if(mddev==NULL){
+			    err=1;
+			  }
+			else {
+			  err = set_array_info(mddev, &ainfo);
+			}
 			for (i = 0; !err && (dev = md_setup_args.devices[minor][i]); i++) {
 				dinfo.number = i;
 				dinfo.raid_disk = i;
@@ -3797,9 +3803,12 @@
 		if (!err)
 			err = do_md_run(mddev);
 		if (err) {
-			mddev->sb_dirty = 0;
-			do_md_stop(mddev, 0);
-			printk("md: starting md%d failed\n", minor);
+		  if(mddev !=NULL){
+		    mddev->sb_dirty = 0;
+		    do_md_stop(mddev, 0);
+		  }
+		
+		  printk("md: starting md%d failed\n", minor);
 		}
 	}
 }

             reply	other threads:[~2001-05-24  7:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-24  7:33 Praveen Srinivasan [this message]
2001-05-24  7:52 ` Jeff Garzik
2001-05-24 10:32 ` Neil Brown

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=200105240732.f4O7WLH23332@smtp2.Stanford.EDU \
    --to=praveens@stanford.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@transmeta.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®