[lkml]   [2006]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[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 <>


    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
    More majordomo info at
    Please read the FAQ at
     \ /
      Last update: 2006-03-11 17:00    [W:0.038 / U:1.492 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site