From patchwork Sun Nov 17 16:31:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 3194331 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A66A09F345 for ; Sun, 17 Nov 2013 16:26:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C59DA20253 for ; Sun, 17 Nov 2013 16:26:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77CF920268 for ; Sun, 17 Nov 2013 16:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754420Ab3KQQ0r (ORCPT ); Sun, 17 Nov 2013 11:26:47 -0500 Received: from v094114.home.net.pl ([79.96.170.134]:62411 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754279Ab3KQQZx (ORCPT ); Sun, 17 Nov 2013 11:25:53 -0500 Received: from afeb192.neoplus.adsl.tpnet.pl [95.49.105.192] (HELO vostro.rjw.lan) by serwer1319399.home.pl [79.96.170.134] with SMTP (IdeaSmtpServer v0.80) id 77cbadd1366e2947; Sun, 17 Nov 2013 17:25:51 +0100 From: "Rafael J. Wysocki" To: ACPI Devel Maling List Cc: Greg Kroah-Hartman , LKML , Linux PCI , "Moore, Robert" , Toshi Kani , Yinghai Lu , Zhang Rui , Bjorn Helgaas , Mika Westerberg , Aaron Lu , Lv Zheng Subject: [PATCH 1/10] ACPICA: Delete all attached data objects on node deletion Date: Sun, 17 Nov 2013 17:31:07 +0100 Message-ID: <6412948.nIyY9Gd76l@vostro.rjw.lan> User-Agent: KMail/4.10.5 (Linux/3.12.0-rc6+; KDE/4.10.5; x86_64; ; ) In-Reply-To: <1421028.Rsfpmhnym3@vostro.rjw.lan> References: <1421028.Rsfpmhnym3@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafael J. Wysocki Since many data objects may be attached to a single namespace node, acpi_ns_delete_node() should take that into account and delete all of those objects along with the namespace node itself, calling deletion handlers for all of them in the process. Make that happen. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/nsalloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/drivers/acpi/acpica/nsalloc.c =================================================================== --- linux-pm.orig/drivers/acpi/acpica/nsalloc.c +++ linux-pm/drivers/acpi/acpica/nsalloc.c @@ -106,6 +106,7 @@ struct acpi_namespace_node *acpi_ns_crea void acpi_ns_delete_node(struct acpi_namespace_node *node) { union acpi_operand_object *obj_desc; + union acpi_operand_object *next_obj_desc; ACPI_FUNCTION_NAME(ns_delete_node); @@ -119,7 +120,8 @@ void acpi_ns_delete_node(struct acpi_nam * detached above, the only possible remaining object is a data object. */ obj_desc = node->object; - if (obj_desc && (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) { + while (obj_desc && obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) { + next_obj_desc = obj_desc->common.next_object; /* Invoke the attached data deletion handler if present */ @@ -128,6 +130,8 @@ void acpi_ns_delete_node(struct acpi_nam } acpi_ut_remove_reference(obj_desc); + + obj_desc = next_obj_desc; } /* Now we can delete the node */