Commit f8c2c420 authored by Tejun Heo's avatar Tejun Heo

[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
......@@ -1397,9 +1397,11 @@ static int ata_bus_probe(struct ata_port *ap)
} else {
ap->ops->phy_reset(ap);
if (!(ap->flags & ATA_FLAG_DISABLED))
for (i = 0; i < ATA_MAX_DEVICES; i++)
for (i = 0; i < ATA_MAX_DEVICES; i++) {
if (!(ap->flags & ATA_FLAG_DISABLED))
classes[i] = ap->device[i].class;
ap->device[i].class = ATA_DEV_UNKNOWN;
}
ata_port_probe(ap);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment