Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3653207pxb; Mon, 24 Jan 2022 14:31:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLyneL0rCjXQyuY6hJJgYCO1HDL6TOqNQ/4Ytus8O7JScyKYPktHpybZ831g7iocbcKIp2 X-Received: by 2002:a63:8149:: with SMTP id t70mr10825565pgd.174.1643063462019; Mon, 24 Jan 2022 14:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063462; cv=none; d=google.com; s=arc-20160816; b=bBHfZ3o0ueg/uXBtET3jlHsptWW8dEbpKhlSAS4/rXgL1MTOCmgAgCCv8+HA62QFnk ryoy65hS7Io5irV4ukYh1mqtrpTkV5LdcUTGWIbtJzttY1jiWB9UqHkTtiT5NXtR2mmF cmRMDJZyUyXmAbgyIHz3PiK3AfFU7pDiEke4E4V6IX13n0gSWJ+EGYjDBJM478F4TWlM 68vww6s5np+SztuDwn0U/iEJnWKYNz8CcG413NKFZKz8DjtLY0Qqv3+sO64tAf/HYe3a r3o4dPUsufhYy9rqzIXTJXVfp63RMLf0A9SbBg0NRCEmCfU5vpHxJwOxsXSArcMGEMlM cXhg== 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=dZSwB62kEkiC0sW2vKh1eO525nju06hR+JllVdhvds9SBtwMiPgdo/BNyieySE6/Lc XgkxiirjhSzc/SzI9Isg67BmV8SE0k2bGVvogMTCCVhp6mmHcL2YCohEUsonVNT3PMwP yJxIBVhLTP44jpqh5l30mRGJU6kuHuuMn+dcV1NfP743vwBLDNXgRfxcLLzWumV+/S4P luoYteTZV8fpd/8se0QVrVwdq4RxeFfARQRfX9z+veSL0ZxpFvwn/uZ+SYlP8FWzNMWL Ha0ScWzgm8baOKheYwCf7Kva300rhevOXfSTEZjiBB3r5T6CXQSdO0YnIdI/EeQZeyuS XDSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jaCJCUV6; 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 e7si4238154plh.419.2022.01.24.14.30.50; Mon, 24 Jan 2022 14:31:02 -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=jaCJCUV6; 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 S1584400AbiAXWVE (ORCPT + 99 others); Mon, 24 Jan 2022 17:21:04 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:50630 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450178AbiAXV3i (ORCPT ); Mon, 24 Jan 2022 16:29:38 -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 4EFFE61469; Mon, 24 Jan 2022 21:29:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10D0FC340E4; Mon, 24 Jan 2022 21:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059777; bh=xZVrHsD0rPsj3VwK4y+uOU/PgOon9I3CUjgItIi+HoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jaCJCUV6apRBmvC/WRkmSRMmHPurcFQQun3IBROqSxFBfYDPhPhj8YyhHh/4lYuCd 3xzL3g22ARsRt2SERhR7sHCrORIqe/l1zOKxepIB+vqNS/RUPfRt7iV5iWYpdy2RKd x5GZZmIEHqx6Rhgc17U3tjHSO+wp+h1ALv+65ezc= 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.16 0697/1039] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:41:26 +0100 Message-Id: <20220124184148.772245819@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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