[PATCH] libata: fix missing classes[] initialization in ata_bus_probe()

From: Tejun Heo
Date: Sat Mar 11 2006 - 10:55:32 EST


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@xxxxxxxxx>
Cc: Jiri Slaby <jirislaby@xxxxxxxxx>

---

Jiri, thanks for reporting this. The offending change has been there
for some time but it's the first time I see it. Probably because my
garbage was never ATA_DEV_ATA or ATA_DEV_ATAPI.

diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 5dbcf0c..d7f9f1a 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1237,6 +1237,9 @@ static int ata_bus_probe(struct ata_port

/* 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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/