[PATCH] libata: fix missing classes[] initialization in ata_bus_probe()
authorTejun Heo <htejun@gmail.com>
Sat, 11 Mar 2006 15:57:39 +0000 (00:57 +0900)
committerJeff Garzik <jeff@garzik.org>
Sun, 12 Mar 2006 00:04:49 +0000 (19:04 -0500)
ata_bus_probe() didn't initialize classes[] properly with
ATA_DEV_UNKNOWN.  As ->probe_reset() is allowed to leave @classes
alone when no device is present, this results in garbage class values.
ATM, the only affected driver is ata_piix.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/scsi/libata-core.c

index 5acb0798534ca4179e99664903c344778eb85d7b..5a0b67a602df237ea5c9d4998d87712178749bbf 100644 (file)
@@ -1346,6 +1346,9 @@ static int ata_bus_probe(struct ata_port *ap)
 
        /* reset */
        if (ap->ops->probe_reset) {
+               for (i = 0; i < ATA_MAX_DEVICES; i++)
+                       classes[i] = ATA_DEV_UNKNOWN;
+
                rc = ap->ops->probe_reset(ap, classes);
                if (rc) {
                        printk("ata%u: reset failed (errno=%d)\n", ap->id, rc);