Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3609543pxb; Mon, 24 Jan 2022 13:27:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyo+u1T2++ZVqTY/wr9DU4QF9LnLJ3r31Z0gY/nwY7JECHvLe/RpThGKR8dHowdHpyD5p+3 X-Received: by 2002:a17:902:8bc5:b0:149:88fc:5560 with SMTP id r5-20020a1709028bc500b0014988fc5560mr16389368plo.144.1643059648231; Mon, 24 Jan 2022 13:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059648; cv=none; d=google.com; s=arc-20160816; b=KeWv8vyfieKtg9hSnQp9mfiLTha6xAaN/azYhe8F5aNsqpmQA41hXgnNupy5h1g9Lw 3+vc8l5of1WOfpeV5z+yHDVv7UL+OoqOqpQI9l4KN5fu+5pFMIExGKrxQMsWfDGB5mRx Jh7+Y3nUpqMXbr4Rg4gh8jx1nS+NP+ykKT/v5BDlT4WyebOwuekJCT2y8sA53P+78c41 RApdV/lKZBp980eWONpKC207alTo7138BzU+AMCCbeNQG/Zw84BQ6gdZik0tDVpbM3bh WWLPAM77rr2Pw4Qicv+tBSHh/Fef43AZcUk8SpdnmqzQlgxAe/2jYfkbVZH14YUwk3S7 9w6g== 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=VLIIk48cD2xQ7/uix/vZdxCBdQ1SjJkuTZCiA6fk34A=; b=RVJiMiZoGbdHx3trz0fW9jMN2XuzXfjlW7tPyul4WMDyReqmGwU9JKJFaz/47I9Ioi 6Yv2Gr2VFvAhjdMp+YIULsWMtYOJ3jJaDmETIdZUp+zvBYnNzxvt7phMtm6zwn9MapZc /hYO27F1Hk1o8asnPOttj1pNPx3FADPkERphL7utxcxXGjTeJerYpfd15G8tJVWMY5j9 8fP9xjtdf8ocrN3Rai7DuDevyuwFYk9N/KsUsmLhp724JbuvCC7ZxvRZDC97V9bcKb5T b2dH8XkBYAuguvrjBERRRuVgYSAJrBvZxFWOU+QScejHzwAeiHwBzGhBfw/BK6fymLDh VzqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aWqWlVkA; 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 27si408336pjd.93.2022.01.24.13.27.16; Mon, 24 Jan 2022 13:27:28 -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=aWqWlVkA; 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 S1444987AbiAXVBv (ORCPT + 99 others); Mon, 24 Jan 2022 16:01:51 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:34382 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385603AbiAXUjP (ORCPT ); Mon, 24 Jan 2022 15:39:15 -0500 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 27262613FB; Mon, 24 Jan 2022 20:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08364C340E7; Mon, 24 Jan 2022 20:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056754; bh=xZVrHsD0rPsj3VwK4y+uOU/PgOon9I3CUjgItIi+HoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aWqWlVkA1aMCIQjP1zEkg/dfjAxzdYq9qZNpEf61YK4nWSeo9Sf6NvhKOtaMhACTK 7tekrEJ+/SblIYVpt0SJS2GOf2pb8p1pNL8KqyI2o7Tco0q7B8SVCMTSC0pxD96TGs RaZ5oDI5sxwz4U0iL0VEqVRwZiWcEaNONQyEohms= 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 5.15 590/846] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:41:47 +0100 Message-Id: <20220124184121.389211625@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 e5ba9795ec696..8d7736d2d2699 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c @@ -422,6 +422,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