]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix SCSI driverfs for IDE panic on boot.
authorJames Bottomley <james.bottomley@steeleye.com>
Thu, 4 Jul 2002 05:40:19 +0000 (22:40 -0700)
committerPaul Mackerras <paulus@samba.org>
Thu, 4 Jul 2002 05:40:19 +0000 (22:40 -0700)
This panic was reported to lkml by Anton Altaparmakov.  The code added to
partitions/check.c to add partitions to driverfs requires preparation by the
calling entity.  There's a NULL pointer check to see if the calling entity
actually did the preparation, but IDE forgets to clear the area it kmalloc's
for struct genhd so the pointer contains junk.

The fix is just to clear the struct genhd before IDE uses it.

drivers/ide/probe.c

index 3081e8b76cf16eb73c410aaa8993a819c593d857..b1b026f76cfcb9663d4c108bf9e9ded60a0bf299 100644 (file)
@@ -1143,6 +1143,7 @@ static void channel_init(struct ata_channel *ch)
        if (!gd)
                goto err_kmalloc_gd;
 
+       memset(gd, 0, sizeof(struct gendisk));
        gd->sizes = kmalloc(ATA_MINORS * sizeof(int), GFP_KERNEL);
        if (!gd->sizes)
                goto err_kmalloc_gd_sizes;