Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4362334pxu; Mon, 12 Oct 2020 17:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuWfvSHFDsJGggVcIv/uPll+HtbTDFjIiMY9OBVovsNxzrFcziJCg8dW6M8ZQMdygABneN X-Received: by 2002:a05:6402:1597:: with SMTP id c23mr16752522edv.155.1602549416044; Mon, 12 Oct 2020 17:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602549416; cv=none; d=google.com; s=arc-20160816; b=DDmbLakCXISgepYsrrEf1uWlG1zque1LLvF2722iHfT7R2Wg/EQI9u+d98O3zidEgk +d9AOHxXcMJ12n+YY64OVQklBDhBqncrJ1s/F0bfSvjt0UEfeKy/XQATL/dTmpS8LDly 3BQWWwZ3by6Mw/hra+gtNeVP26fZr4HQB51EghvVyxtrbxXgVO1bAkVcNCBvH+sy6kxz LgcHfX4EG3eBMthDEGSftiU6Mc9SnL4uyZIdwZvz/HU6tDzS/AJymSW2gsRjzUrdpKKM FJ4LMRDBudQVJF2pNR+d58R819JobwCraH1G7Wl4ZevtZZBR3mTcBwPAKzjetix+Z0hU cQAw== 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=wfnh2LWcTomr0bewcCfqI1xW5q75KLiVFMO5dkKsgbU=; b=byrGhC/3vBD77z0oL8if4kB/yAHlPRWXYmeCGNoL28eZci950RIO/LxWyl83R2CqWg emO7Bc9hxPcENBU50RpQlLD1cTlD4hGEomiJmtxMD4p9bn5nQkcuxFwbQc6StR12P8Nk OHrZJwlk+QdBmoOLpzU9q9cmJDEunCbt+5yFhBKJr8o1qWAGhBHu3BFXq+ldIRiAZ99Q X67MgEu91kDF1ZQNe4Fra3vl11BYZfAl931bocHw90xJq09xwyMtjnAYRM+SR2qwQEkF 4sFbTY9Z6Hwf9WoRSrumWFVYBkGN49ZF5LCJldSR+pkj2Z834LCz5vxvhGrFkfcIvurV bbKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KMDMz5xk; 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=fail (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 t26si13196512eds.280.2020.10.12.17.36.32; Mon, 12 Oct 2020 17:36:56 -0700 (PDT) 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=default header.b=KMDMz5xk; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390845AbgJLODA (ORCPT + 99 others); Mon, 12 Oct 2020 10:03:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:40114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731239AbgJLNio (ORCPT ); Mon, 12 Oct 2020 09:38:44 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B5B0221FF; Mon, 12 Oct 2020 13:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509910; bh=t7UcJzs0lJA9TKsNXLWavn7gjoQpqohjZOzFMNgpw5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KMDMz5xkhG2rD02F9TRr91osjONSUayR0qcmi17SYEbqVgfi1buLTZpYurLAbxnck 4lpQfWMdOjm1qjNubuaJCyXjZRM+LcqSTmiPC+g3o9P6vd75nmVbD+DwmkA7TzOSLj fzRCs5QOEDq/K/2SO9giAVudhfX4N0KDANOATKxw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Ma , Andy Shevchenko Subject: [PATCH 4.19 11/49] platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse Date: Mon, 12 Oct 2020 15:26:57 +0200 Message-Id: <20201012132629.954989195@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132629.469542486@linuxfoundation.org> References: <20201012132629.469542486@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: Aaron Ma commit 720ef73d1a239e33c3ad8fac356b9b1348e68aaf upstream. Evaluating ACPI _BCL could fail, then ACPI buffer size will be set to 0. When reuse this ACPI buffer, AE_BUFFER_OVERFLOW will be triggered. Re-initialize buffer size will make ACPI evaluate successfully. Fixes: 46445b6b896fd ("thinkpad-acpi: fix handle locate for video and query of _BCL") Signed-off-by: Aaron Ma Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/thinkpad_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -6879,8 +6879,10 @@ static int __init tpacpi_query_bcl_level list_for_each_entry(child, &device->children, node) { acpi_status status = acpi_evaluate_object(child->handle, "_BCL", NULL, &buffer); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status)) { + buffer.length = ACPI_ALLOCATE_BUFFER; continue; + } obj = (union acpi_object *)buffer.pointer; if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {