From patchwork Thu Jul 30 01:11:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 30374 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by bilbo.ozlabs.org (Postfix) with ESMTP id BB388B7B7E for ; Thu, 30 Jul 2009 11:11:55 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756049AbZG3BLw (ORCPT ); Wed, 29 Jul 2009 21:11:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756062AbZG3BLw (ORCPT ); Wed, 29 Jul 2009 21:11:52 -0400 Received: from mga09.intel.com ([134.134.136.24]:11577 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756049AbZG3BLw (ORCPT ); Wed, 29 Jul 2009 21:11:52 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 29 Jul 2009 17:58:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,291,1246863600"; d="scan'208";a="434544049" Received: from rzhang-dt.sh.intel.com (HELO [10.239.36.207]) ([10.239.36.207]) by orsmga002.jf.intel.com with ESMTP; 29 Jul 2009 18:18:35 -0700 Subject: [PATCH] ATA: fix a problem that ata port print_id is used uninitialized From: Zhang Rui To: linux-ide Cc: "Zhang, Rui" , Tejun Heo Date: Thu, 30 Jul 2009 09:11:56 +0800 Message-Id: <1248916316.2670.160.camel@rzhang-dt> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org fix a problem that ata port print_id is used uninitialized. port print_id is initialized in ata_host_register, but it's used in ata_host_start. Now move it to ata_host_start, before it's invoked for the first time. Signed-off-by: Zhang Rui Acked-by: Tejun Heo --- drivers/ata/libata-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/ata/libata-core.c =================================================================== --- linux-2.6.orig/drivers/ata/libata-core.c +++ linux-2.6/drivers/ata/libata-core.c @@ -5963,6 +5963,8 @@ int ata_host_start(struct ata_host *host for (i = 0; i < host->n_ports; i++) { struct ata_port *ap = host->ports[i]; + host->ports[i]->print_id = ata_print_id++; + if (ap->ops->port_start) { rc = ap->ops->port_start(ap); if (rc) { @@ -6107,10 +6109,6 @@ int ata_host_register(struct ata_host *h for (i = host->n_ports; host->ports[i]; i++) kfree(host->ports[i]); - /* give ports names and add SCSI hosts */ - for (i = 0; i < host->n_ports; i++) - host->ports[i]->print_id = ata_print_id++; - rc = ata_scsi_add_hosts(host, sht); if (rc) return rc;