From: Tejun Heo Date: Sat, 11 Mar 2006 15:57:39 +0000 (+0900) Subject: [PATCH] libata: fix missing classes[] initialization in ata_bus_probe() X-Git-Tag: firefly_0821_release~37605^2~13 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2061a47a9b9530a9523e51167c996307db951c31;p=firefly-linux-kernel-4.4.55.git [PATCH] libata: fix missing classes[] initialization in ata_bus_probe() 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 Cc: Jiri Slaby Signed-off-by: Jeff Garzik --- diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 5acb0798534c..5a0b67a602df 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -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);