Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3579154pxb; Mon, 24 Jan 2022 12:41:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTY6nSkaygJ9OFEgkXvVLyotm2aHpxc2jW9IO4SSPc08eULcaeqzeGjqLspvMg6oer90D3 X-Received: by 2002:a17:90b:4b0a:: with SMTP id lx10mr106768pjb.176.1643056896451; Mon, 24 Jan 2022 12:41:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056896; cv=none; d=google.com; s=arc-20160816; b=ryxvyRLt9v8nS5Ij9JCw+c61kPV6EsjmhudO7AEM/2+uJrG+ERXrkQ0NmTpTxK2QlW 7+87cf37hOPM2uxtgK43vi/kuKTwenoYMvB1dpsvhIAqdxJ1wTRm3i0oxo9YsstPcwKv R3YmYRh7ZIhNbs257imwjukLh6P+YK4QHzrFeWhEwbBWBlzRmxaAu/FeA09vgoNDj/v9 mNjCxbAlFkyf9XkGtXI0I3zRzN6P5K+5WvC27T8V4pIb/BnxCwNr0I7VWw5LnTq37ZVD LdkhOK2/Vbo1wIccG4PAQcweIp+0R2/HdyDgpM8lUcYdGY9Uzmks1e5S1i6Wby6q7BTy ZI0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3XsRZC2LWuJ9RMxtjb6ScIdZWHutVh9k0yijYw2dQgw=; b=PWGeaDr/g0qY0xQhwjbicfZrYd0HaYJrMAop6Vtm0X0yvR0H39En6SVpiR15z3gkHM aNDkj9aHgJDkbY7brG3A9AlTJACYcCDIGboYRlgJyBw+7nnCeFUd/MLnNwCfZ1Yday2/ Dl3jCj9OXN+PinI5gpz8mNRjvEKt1DirY4pXDuUV6E9olAohdIa6XXX+CYZ8CWKB35F1 1IqLaZDe10W5HyDGV3wV3cS2bW1NBBYF4UH/x0Rio5V3LLLiBb2Whde+E1T+71TS/sw5 SiW4Bx5bROL5UaAPOBIIAVfvHy+SMsx+/RdhQRfgRCWwsWReOugk9KPiEN6wsCM0BLjH 6y2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ufSMoEWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a72si11225117pge.425.2022.01.24.12.41.20; Mon, 24 Jan 2022 12:41:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ufSMoEWa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358644AbiAXTze (ORCPT + 99 others); Mon, 24 Jan 2022 14:55:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349088AbiAXTlA (ORCPT ); Mon, 24 Jan 2022 14:41:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D4DDC07A96E; Mon, 24 Jan 2022 11:20:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2B27060010; Mon, 24 Jan 2022 19:20:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F165BC340E8; Mon, 24 Jan 2022 19:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052019; bh=7z0emsLHzxyyyK8JWHHyYkGDcaTiOkQ8xx+Sr2z/9nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ufSMoEWayBjVU7LYzvDVhxIOdo/qMLbNEqCLP7fo+cWLBEyDe9SePQMcqM7vgvUFs XDlwxbatxuK6iDdJSKVNZiTmnUPRvynKIznBAEC/ms81syrw/vXygVBjpJZs3+g4wb c3x36aJPq9V7bsje+qr/Ba9Zgt0gk7L0EUPyW6sQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Asselstine , "Rafael J. Wysocki" , Bob Moore , Sasha Levin Subject: [PATCH 4.19 161/239] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:43:19 +0100 Message-Id: <20220124183948.217644407@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki [ Upstream commit 1cdfe9e346b4c5509ffe19ccde880fd259d9f7a3 ] ACPICA commit c11af67d8f7e3d381068ce7771322f2b5324d687 If original_count is 0 in acpi_ut_update_ref_count (), acpi_ut_delete_internal_obj () is invoked for the target object, which is incorrect, because that object has been deleted once already and the memory allocated to store it may have been reclaimed and allocated for a different purpose by the host OS. Moreover, a confusing debug message following the "Reference Count is already zero, cannot decrement" warning is printed in that case. To fix this issue, make acpi_ut_update_ref_count () return after finding that original_count is 0 and printing the above warning. Link: https://github.com/acpica/acpica/commit/c11af67d Link: https://github.com/acpica/acpica/pull/652 Reported-by: Mark Asselstine Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/utdelete.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c index 0dc8dea815823..db79a826e6b8d 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c @@ -410,6 +410,7 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action) ACPI_WARNING((AE_INFO, "Obj %p, Reference Count is already zero, cannot decrement\n", object)); + return; } ACPI_DEBUG_PRINT_RAW((ACPI_DB_ALLOCATIONS, -- 2.34.1