lkml.org 
[lkml]   [2001]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] md.c - null ptr fixes for 2.4.4
Date
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);
}
}
}
-
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:53    [W:0.035 / U:1.000 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site