Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3389745pxb; Mon, 17 Jan 2022 19:23:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJz39/pq8aF+B5bdy50nRemhh9+Rx49ZLxuSM98u690i4Ovd88Sn9VIvjRTuZJN1/DeWeCK1 X-Received: by 2002:a63:61d3:: with SMTP id v202mr8068831pgb.120.1642476229972; Mon, 17 Jan 2022 19:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476229; cv=none; d=google.com; s=arc-20160816; b=EhyDFPsqOTRcXf0Jo3WBxjqqOiohs+VmbApkfeaDwNRHwrUFFnVylKUPSR2x0dYjtf J8Tg34NdpFMqjTOfIYNAyqpZtqF0ewEXQGVIP2Obhi9Z5Qb8vT1sofV7tR+GWX82ePeC 1oxE699vukvv3Sqi/i3l+vmA7xjcQhWb8YOGcFIuYsdf/F7TmPSFEBbnz7IX3p64eg87 OoRoXgQThY4q26IloAElQsVoscGBgfncHkQSHRNZwS0aweiOWR3m8XibaiXXv4AsE9XC qScI3O9srCDoKwlVC77h5NCY13WI1nd5LFC2BL2hQj/R/DTLRK/mXLbXohjlniKa6TNu +/uA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JJO9PRfSMQhMEUaapmMnR+uqla4V6clYOSykCkOXkj4=; b=dJ92KB8XcFwlCVwcJ4GyoNAYt8mwVLsu2C2DroqyhKKeYyWbipj64G1k6sqTlq5Ukg zOuvEENdopz5xnW+0z/A9+NSazkfJyJfgwS2a2eBT614Q9B4VCqW9D6FzfmLh9jLis2g +Zb+BdFrhi5cPJXcebaG2+CKtdiONAPrV5TBO5kiIgefMbYZbCRWftdlNeD/89fEkvT5 F9bEkJt8KZDnHEx/+F3iP6KQG252R7z4AKKbZkZ8rSkeJjQyuPL0BTnFWO/HI+rlvBIz qwI6yoW9rHgV5HZCyCTlty/0ZXg6X142PNY44P9ftBQPG3Z7iZBZORrKJuCJk3jDIr/Q vfmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cC1L3Jki; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c3si16668142pgm.268.2022.01.17.19.23.38; Mon, 17 Jan 2022 19:23:49 -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=@kernel.org header.s=k20201202 header.b=cC1L3Jki; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343557AbiARCdr (ORCPT + 99 others); Mon, 17 Jan 2022 21:33:47 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:46718 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344244AbiARC3Y (ORCPT ); Mon, 17 Jan 2022 21:29:24 -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 289EB60AB6; Tue, 18 Jan 2022 02:29:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A73D2C36AF5; Tue, 18 Jan 2022 02:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472963; bh=Pmo6IF4IBwL5Qx1rzocHFg+51u517NDJnuUHyGjU8H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cC1L3JkinZ8vJHlmD8IBxKih1YNTthwzETKtUNxn9UoQszKMzDyhTgEaEdvTCm2uL C0YpFAPPxZSmhc6grBm3PubHMYXciFMXdw0BkGOUGlwaR+0nnPRByBy1KczTZ7tF1J ndcZxo9P08lO8GhacDzMLhClplDIvQtaPEjtl0kaoUXAChsMF8kS2bC+LFOmbqRyvQ 2aGyKOLTmnviWoIzAZJ2d1r6cd3gA289OJavNhL7pClnHWmsmZtANEr20HBMXzXM3w 47oe67VUtPMTJV00o/89AZdplsXNepF7+3lNbUuqbX0moBKdfRuXDcXwblWI6nNDSK PF0FOMBoPVXdQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Rafael J. Wysocki" , Mark Asselstine , Bob Moore , Sasha Levin , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH AUTOSEL 5.16 180/217] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 17 Jan 2022 21:19:03 -0500 Message-Id: <20220118021940.1942199-180-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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