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.
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;