From patchwork Thu Jun 25 09:39:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 32345 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5P9dCnj029801 for ; Thu, 25 Jun 2009 09:39:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751561AbZFYJjH (ORCPT ); Thu, 25 Jun 2009 05:39:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754374AbZFYJjH (ORCPT ); Thu, 25 Jun 2009 05:39:07 -0400 Received: from mga03.intel.com ([143.182.124.21]:15612 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561AbZFYJjH (ORCPT ); Thu, 25 Jun 2009 05:39:07 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 25 Jun 2009 02:39:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,289,1243839600"; d="scan'208";a="158357633" Received: from yzhao-otc.sh.intel.com ([10.239.48.81]) by azsmga001.ch.intel.com with ESMTP; 25 Jun 2009 02:39:08 -0700 From: Yu Zhao To: jbarnes@virtuousgeek.org Cc: linux-pci@vger.kernel.org, Yu Zhao Subject: [PATCH] PCI: check if bus has bridge device before triggering Secondary Bus Reset Date: Thu, 25 Jun 2009 17:39:31 +0800 Message-Id: <1245922771-1474-1-git-send-email-yu.zhao@intel.com> X-Mailer: git-send-email 1.6.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org For devices attached to the root bus, we can't trigger Secondary Bus Reset because there is no bridge device associated with the bus. So need to check bus->self again NULL first before using it. Signed-off-by: Yu Zhao --- drivers/pci/pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 6c93af5..20351a9 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2171,7 +2171,7 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe) u16 ctrl; struct pci_dev *pdev; - if (dev->subordinate) + if (dev->subordinate || !dev->bus->self) return -ENOTTY; list_for_each_entry(pdev, &dev->bus->devices, bus_list)