Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4272208pxu; Mon, 12 Oct 2020 14:28:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8czhay51G+wXfXcyd83N/pquyY61Sj/F6dFUzUA78+7alCA0KKxDAbu4UkYhOtMPoYWur X-Received: by 2002:a17:906:2714:: with SMTP id z20mr29314594ejc.409.1602538130033; Mon, 12 Oct 2020 14:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602538130; cv=none; d=google.com; s=arc-20160816; b=NGLbydnln6Rbo4bNoM/g3JWSKD0Rvr6hgbjCjVbfWIC7xFxzn9PB62GpJVH8oVZoMn LbLGG68goR0JT9ePQwKnNURlYPtr7pGNokmMRVnL8Xq66us3F0D4WFnc9z1mvet0oiMv bRKQbX5/yfdyPPIKWQo7Ol94YESTd3r+smGs4A8jlEhQshYIaYPTmdbMAOhWoez7Ir8y WIAu7+jk8X+JQjm7TDVCdJknPCCAo1vtITt85zknBvpHW1AkBN09WyeKkEQ5kHz0p67j JYts/sM5+O7kz395lJpVkz7n18B/FT+fijyI7BDYQgFE0T2JzDMNnu2YD4iMhghaP+kc 7VIA== 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=dGmPBXG0Ib032oD5zSfjRm5tJerafSH1L9WD+y3MY1w=; b=xwyXTAetpcyyTGIXTnNPLbN/PAbrLm/eM8F+upniCNIBWK+BfETaZB3mM9sCKuT0s5 +yE6IgwvAhNoAcwABlyalsLZO4Z9lBRRWxZTETprhrY1gx93EfaZBESFTw69nNQLwRBe KmPSsD75Pajwd0I16DPr3z5snpP5qbCrVuloput5EONsWvhh5XpRMyzJvYG6Le0X/MUE QAleSJ1EnOxemM3EB2QUJPplELeDS8ceBkIZbkpFp+ZfzjRsrK4XYfAwHIDsyaV4IqJ+ Zn1j0QXk5Ql6WyEOJOzsvEqWHU1a3HVHnB11Er0BA/EQQi6qr91eAE+VYrdY1rucDh4w oRBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JpBSX2Gv; 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 o1si12616362eje.149.2020.10.12.14.28.27; Mon, 12 Oct 2020 14:28:50 -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=JpBSX2Gv; 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 S1729666AbgJLNhq (ORCPT + 99 others); Mon, 12 Oct 2020 09:37:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:40140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731011AbgJLNhP (ORCPT ); Mon, 12 Oct 2020 09:37:15 -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 1D5D621D81; Mon, 12 Oct 2020 13:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509811; bh=Vg1T2YZp02cZX+Ff+PnbpejyRUOriqiX5Ovu8vTRhfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JpBSX2Gv2NoxjjOzj87X2zzAGFAOx+/nAGcUfzWEsVKu9kRPeoYLzmuQxVHT1rPJx diGcF6iNDmytdEpjwMbkomOJ/nbFrQ/c2IQumAWIpP9dY6GqQ3pTbKcenLvj44+Ray yhZQ4fXpQZA8X4GMNF3vIlY0zz0n+6fLQ4irKRMw= 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.14 39/70] platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse Date: Mon, 12 Oct 2020 15:26:55 +0200 Message-Id: <20201012132632.060315100@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132630.201442517@linuxfoundation.org> References: <20201012132630.201442517@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 @@ -6749,8 +6749,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)) {