Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3555327pxb; Mon, 24 Jan 2022 12:07:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcJjkR+OhbjXtZ69u1dyCUDtFLOIej/KVsd9T6JfYUeubeGBauDJBGNQDWjNeVuUEpy1U+ X-Received: by 2002:a17:90b:1d0e:: with SMTP id on14mr3498846pjb.202.1643054838397; Mon, 24 Jan 2022 12:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054838; cv=none; d=google.com; s=arc-20160816; b=IsrBKbX4TKJ3eGodMMAu79L2e9Wpu7a2BtL2PpGdgz3yeSS+mrtuQsMjokM+7l+cgU GN4euYdNbHUu6GpVFq2e3DmfaiR8smKT3DQ7oh2+aFrMAf8xatlIVGyw2mUKYOhX7z+v HB7gT5T54oLIvk1eSGqg7neJnJwyZlzgEQZNxBz7zpT3tGS3bR3pI4ZmytfZ6rkTeR7I 3euqAdpMK1zgSaMTflUIKGLQgXqJtNmqqDcuV3VBWoUh3nStR3saMt4riazMIwO7jm+m EME3jifZwwmMM/mnfSY+7qsZkU7Srnpk3TV1Q7+cx46Xj5nd24KHGkireFlsCA4qZ+lg b6EA== 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=s08R4iuqPKoxVjZVhTmym526niVAAIyz6rJ78CvIJ1s=; b=L2mCFXzALrZCOT5rI60WLaHZ+/sfLXAFQFxi/Jg87fc+43PYgia4EiuHge0cRQbrT2 8s8UzT784bb90J4hfnwvvBoGYb6mo1VS4696Vp5wTLXwFsv2mHtVrDDaZgt+3mOFtnz6 E9WZIL9JqIAPOImNNJIpVT/to4UZY/7eX/x35pcI5IRcVUjEN+O8xWcll6+Raqsn7YTY xbShLSo1Cj6JAsp+viPNtpskz8QiIBz1fzHqmLJEzuD7VVav586DreKV0NlSanL1Q+sO lXEws8lPSRV+bHb3Muhlt1e7E+l4nI/PpSBpuCr/ZkAIcmYUh2jaXi9C7wgDeZ96PDOw XZgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Z/a3xXon"; 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 d4si243770pju.141.2022.01.24.12.07.05; Mon, 24 Jan 2022 12:07:18 -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="Z/a3xXon"; 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 S1346059AbiAXTFB (ORCPT + 99 others); Mon, 24 Jan 2022 14:05:01 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:57802 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344004AbiAXS6v (ORCPT ); Mon, 24 Jan 2022 13:58:51 -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 B55F461569; Mon, 24 Jan 2022 18:58:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94B14C340E5; Mon, 24 Jan 2022 18:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050730; bh=qOpc2/0oxmHJE4wi0lGuFKhNcUljuprERWZbbP+bl24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z/a3xXon8Q8Nb57+0xAtzKnyuTjpc0zft6jKYsA+h8Mpen+4jtDy/ICf+h/Ws1us1 gHBfvVTEUl3lmcTV68gq8VRRBf4DGKP8ADj3DOuO/0Eln7dlKVwJs2uWIftqmxp9NY mH43yI/cKqNDoPLBAOEiDTS11H5qKyIrjkb+y7UY= 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.9 095/157] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:43:05 +0100 Message-Id: <20220124183935.790529145@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 03a2282ceb9ca..81a9c47973ce8 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c @@ -440,6 +440,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