Commit 6fe152cf authored by James Bottomley's avatar James Bottomley Committed by Paul Mackerras

[PATCH] fix SCSI driverfs for IDE panic on boot.

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.
parent af8b4810
...@@ -1143,6 +1143,7 @@ static void channel_init(struct ata_channel *ch) ...@@ -1143,6 +1143,7 @@ static void channel_init(struct ata_channel *ch)
if (!gd) if (!gd)
goto err_kmalloc_gd; goto err_kmalloc_gd;
memset(gd, 0, sizeof(struct gendisk));
gd->sizes = kmalloc(ATA_MINORS * sizeof(int), GFP_KERNEL); gd->sizes = kmalloc(ATA_MINORS * sizeof(int), GFP_KERNEL);
if (!gd->sizes) if (!gd->sizes)
goto err_kmalloc_gd_sizes; goto err_kmalloc_gd_sizes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment