Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3548588pxb; Mon, 24 Jan 2022 11:58:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3kQv3ud4xyiHkm5RHWq1YCVZ1OlC7fBkROEWQAOTfXVWUS/FBDD/0xgZToGwzGlhns8DL X-Received: by 2002:a17:90b:3e84:: with SMTP id rj4mr3498910pjb.110.1643054249838; Mon, 24 Jan 2022 11:57:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054249; cv=none; d=google.com; s=arc-20160816; b=Y2eSH2ch3ZJRfy5P/OrqF5RjLKNBBwYEmRIe0PcJRZXSQrhahNOFeNfnjEohneuRvN niDJ+DYr8r3ohNHcSOaw0lfGLZDlMWCR71yIJpYGJs30iOom5lez7y1E9+Abzdfs4yh/ BOIsQw78/TbUWauI55vVWMdmIj8I/S3cUCKEgybHjVjZhFKKICWJ21QfunoyCf8KtK5V hEmqe3dp39u27tPcvDqJgvd156t7PB36pU0rqyYBn0YXxV4SW2f4ccO3TCD7KCIempsw Mz2hRspHx7xPy/3QxDrGvXiSfZkXzmJKLgS3ArKvP4L+tE7XcY2ojJclGvmPMhgS6VMi kPiw== 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=1IbxH1+5sniirivTparWdFew49FAdP/xh6vP3iaWzYc=; b=NH/nTdcjiHK4WusDxg8uaho0b+VDgyJ1hL8B0xA3/FOn1XC/j3x8F6scj6ZUC/WELX DfEphnC8T4aYyklH2i0lD55iqxL8Q2o3Yk/n2YRVvdS3U/T1SWm4sA0pbQRiXpLhVgco ulU/qux8UOVj/JvGmLVBvuzucFqik/60+mekrlrxGrvGjdW+7Q8WAWQ6DFsuw4LtsMVt uwFx6CztgJ3IYeNrFUIgIE+QVuB/7fsey2qZ830CB0PeNUum0P4lA12wbx9+4fDFm3SD V3Xe71gEudNf4shLewZyKebO1qNalKhLHTQkFYhVSL5r1g9z89Zd1ODrTIXlmSFSW6GY GbxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1xvG0jiN; 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 b19si14087217plz.574.2022.01.24.11.57.15; Mon, 24 Jan 2022 11:57:29 -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=1xvG0jiN; 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 S1344029AbiAXSxM (ORCPT + 99 others); Mon, 24 Jan 2022 13:53:12 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:50970 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343755AbiAXSvn (ORCPT ); Mon, 24 Jan 2022 13:51:43 -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 ams.source.kernel.org (Postfix) with ESMTPS id B098BB8121A; Mon, 24 Jan 2022 18:51:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7E46C340E5; Mon, 24 Jan 2022 18:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050301; bh=grI4u8o/65l7DGOuYfV+pUOSJnr68kyNlzxbNKNfxLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1xvG0jiNchsAaaerZkIH686oNJcs2+BUEUyPSN/7kbir1pUmaiZmq3CDNgk4axvf3 1vG7hk/hWFZRJDc/Dqx0S0a7XE5VCqiAgTNjOhqm5j8oxTfIA8s6DKrfvadCbBM3Qp 1SqD4KTIo++h4KDHQ00M9h72/4TX0Wa2vr2GsTuw= 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.4 074/114] ACPICA: Utilities: Avoid deleting the same object twice in a row Date: Mon, 24 Jan 2022 19:42:49 +0100 Message-Id: <20220124183929.380763040@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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 9f8b088e21d7e..d90b2cf310fb1 100644 --- a/drivers/acpi/acpica/utdelete.c +++ b/drivers/acpi/acpica/utdelete.c @@ -439,6 +439,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