Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3570880pxb; Mon, 24 Jan 2022 12:29:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBLCP546bQZLDfFWkNJ8jA8O2rhN7tijEemQWkxjeFbObiqKqk92mSyYJgT9nFiBtdqqwP X-Received: by 2002:a05:6a00:230d:b0:49f:b8ad:ae23 with SMTP id h13-20020a056a00230d00b0049fb8adae23mr15098113pfh.80.1643056173988; Mon, 24 Jan 2022 12:29:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056173; cv=none; d=google.com; s=arc-20160816; b=jEemzXI9o/FB43X0xH7XnRxD5XMVxVCtGSHnhmDEZGznKtMy/kgEb90dS2O5ciJhhP s9v3z+Ih7+fg29ixSbvRaeTV7CmcEETkvysz+Nh5+nGRQx/2YKEUHLZidEeDL3WKs0GX klJcRLrvMFmfEGCVgirXN3sLGa1XOrbbO4boX6tABUGinLXx2SVR4BFtBGqSNrAJgXA8 vE9Sv+tIh42XfPALUJZe6kv67J3E5D6I6xSYpuRy7lmtHLXUh8qt+D2fg6Ofc23TRTx+ y2nGBjKM65iHRF5LBMMHpv8erlWQfPtvWCNe9r+/auSLJxM3cOBlwMOILKyZnE0B2OaY f6vg== 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=bdmcmul3X64pBn1SEw2nbqHWTG7RjHul78W6nOCZd98=; b=FiRJeVFHBDuajtAO8haJD27eEIci40lvo78aj8AjHxbSsyr7cbrs8Ay9ZT1L2r3Ibt KdbMcgcTWSaNbbc1f8DfJRtmankSW6IVlNOuFPLe+kEMzDEKuN/ekw5993ma37EF34vn tGOgy4a2PUKma7aNvpjWUwJWxFzIK6XztyYTMfWOon5dEw5fkadXg3W0SgjhPYBadl2k JFYblH4Wu8DW33ozrOQbUCU7OgDlubm5fDxG98sH+NdhW2N8X9YrNzxS3sZitkTXN9BU qDEQI3FcOTOg6bZQUBfkX3zxfgk6hAAHDd+zMejNET33ShSLFKSmgRMY7WWJn0QrQWn+ A43Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KbjnB8Fl; 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 w14si7648339pfu.290.2022.01.24.12.29.22; Mon, 24 Jan 2022 12:29:33 -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=KbjnB8Fl; 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 S1352438AbiAXTa1 (ORCPT + 99 others); Mon, 24 Jan 2022 14:30:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349832AbiAXTVY (ORCPT ); Mon, 24 Jan 2022 14:21:24 -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 9697EC061797; Mon, 24 Jan 2022 11:08:22 -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 3DDBF60EC4; Mon, 24 Jan 2022 19:08:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42681C340E5; Mon, 24 Jan 2022 19:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051301; bh=pQnXVxQeSfUMLf41pmrb63t4YYQ2bvU2J9f+z1HT2PQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KbjnB8FlYfkT6qPx/lNFPR3MeYX+4sNqlqzz5UfnoGRVN+wc3ulapmmjk4fpMjhDy 7N2t8Ni8MzGMvXgsYHb61u4hD0xro6mXl+nr9C5lQUS9edhanHcMUpmeYzMSlOeYmN DodnOHUtmv/5FMedXEEqBLg1LWR5C6itHP5mlD2g= 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.14 119/186] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:43:14 +0100 Message-Id: <20220124183940.941645419@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 61a979d0fbc5a..64a90ba71f18c 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c @@ -442,6 +442,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((ACPI_DB_ALLOCATIONS, -- 2.34.1