From patchwork Thu Aug 16 12:12:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 1331111 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C47FD40210 for ; Thu, 16 Aug 2012 12:13:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754141Ab2HPMNM (ORCPT ); Thu, 16 Aug 2012 08:13:12 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:10566 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754107Ab2HPMNK (ORCPT ); Thu, 16 Aug 2012 08:13:10 -0400 Received: from 172.24.2.119 (EHLO szxeml202-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id ANG98298; Thu, 16 Aug 2012 20:13:08 +0800 (CST) Received: from SZXEML405-HUB.china.huawei.com (10.82.67.60) by szxeml202-edg.china.huawei.com (172.24.2.42) with Microsoft SMTP Server (TLS) id 14.1.323.3; Thu, 16 Aug 2012 20:12:58 +0800 Received: from localhost (10.135.76.84) by szxeml405-hub.china.huawei.com (10.82.67.60) with Microsoft SMTP Server id 14.1.323.3; Thu, 16 Aug 2012 20:12:59 +0800 From: Yijing Wang To: Bjorn Helgaas , CC: Hanjun Guo , Jiang Liu , Yinghai Lu , Yijing Wang Subject: [PATCH 2/3] PCI, acpiphp: Use list_for_each_entry_safe instead of list_for_each_entry Date: Thu, 16 Aug 2012 20:12:21 +0800 Message-ID: <1345119142-5896-2-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 In-Reply-To: <1345119142-5896-1-git-send-email-wangyijing@huawei.com> References: <1345119142-5896-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.135.76.84] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org list_for_each_entry is not safe, use list_for_each_entry_safe fix this. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/acpiphp_glue.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index a372ade..7bbd6bf 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -1082,11 +1082,11 @@ static void acpiphp_set_hpp_values(struct pci_bus *bus) */ static void acpiphp_sanitize_bus(struct pci_bus *bus) { - struct pci_dev *dev; + struct pci_dev *dev, *tmp; int i; unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM; - list_for_each_entry(dev, &bus->devices, bus_list) { + list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { for (i=0; iresource[i]; if ((res->flags & type_mask) && !res->start &&