Re: [PATCH] md.c - null ptr fixes for 2.4.4

Neil Brown (neilb@cse.unsw.edu.au)
Thu, 24 May 2001 20:32:20 +1000 (EST)


On Thursday May 24, praveens@stanford.edu wrote:
> Hi,
> This patch fixes some unchecked ptr bugs in the multiple devices driver
> (RAID) code (md.c).
>
> Praveen Srinivasan and Frederick Akalin

Thankyou.
However I suspect that a much simpler patch would be:

--- ../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,10 @@
continue;
}
mddev = alloc_mddev(MKDEV(MD_MAJOR,minor));
+ if (mddev == NULL) {
+ printk("md: kmalloc failed - cannot start array %d\n", minor);
+ continue;
+ }
if (md_setup_args.pers[minor]) {
/* non-persistent */
mdu_array_info_t ainfo;

WARNING - patch created by hand, not tested.

If this is an issue. i.e. if alloc_mddev fails this early in the boot
sequence, then I think you have a very sick computer...

NeilBrown
-
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/