Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751031AbWCKP5p (ORCPT ); Sat, 11 Mar 2006 10:57:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751189AbWCKP5p (ORCPT ); Sat, 11 Mar 2006 10:57:45 -0500 Received: from zproxy.gmail.com ([64.233.162.195]:58921 "EHLO zproxy.gmail.com") by vger.kernel.org with ESMTP id S1751031AbWCKP5o (ORCPT ); Sat, 11 Mar 2006 10:57:44 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=XDveVdJCrrVT1TOrGxHzYFejZ3fhiEbG4DImKXL0tkWbQYtX56ENP42VXfYeQbzVVT7JN+J1NeKr+Jgq/8zyuRr86JfpU0xOk/fusKgb7BnS+0Y+070QK/05+2FKML1FeXgopU5RwjEXSwJFknbW4cWNCJZM9EvKMBnh0W2SYek= Date: Sun, 12 Mar 2006 00:57:39 +0900 From: Tejun Heo To: Jiri Slaby Cc: Andrew Morotn , Linux kernel mailing list , jgarzik@pobox.com Subject: [PATCH] libata: fix missing classes[] initialization in ata_bus_probe() Message-ID: <20060311155739.GA23806@htj.dyndns.org> References: <20060307021929.754329c9.akpm@osdl.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060126 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1225 Lines: 33 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/