Commit f8c2c420 authored by Tejun Heo's avatar Tejun Heo
Browse files

[PATCH] libata: fix ->phy_reset class code handling in ata_bus_probe()



ata_bus_probe() doesn't clear dev->class after ->phy_reset().  This
can result in falsely enabled devices if probing fails.  Clear
dev->class to ATA_DEV_UNKNOWN after fetching it.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent 6cd727b1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1397,9 +1397,11 @@ static int ata_bus_probe(struct ata_port *ap)
	} else {
		ap->ops->phy_reset(ap);

		for (i = 0; i < ATA_MAX_DEVICES; i++) {
			if (!(ap->flags & ATA_FLAG_DISABLED))
			for (i = 0; i < ATA_MAX_DEVICES; i++)
				classes[i] = ap->device[i].class;
			ap->device[i].class = ATA_DEV_UNKNOWN;
		}

		ata_port_probe(ap);
	}