Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp700380pxb; Tue, 5 Apr 2022 19:20:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7aiyn2DECczh+b3j1JYUtuC/TgnYs58o8uByjAFP+yA2wAyWUhnm9xwvLmHv8vyxsDpDv X-Received: by 2002:a17:902:8c81:b0:156:7fee:643b with SMTP id t1-20020a1709028c8100b001567fee643bmr6335035plo.59.1649211562454; Tue, 05 Apr 2022 19:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649211562; cv=none; d=google.com; s=arc-20160816; b=qMaqnsPlgQsZ97yUqzYbUZbX7ZDwnAqaNZdB1wuM8kRzgiqfpD0L4YloeN0CiAMZud WBQQ8NOfJPOnKx18w1H9Wlj17sgLU+zoFz6KJ/23ZvpQyoMLfhtRhEfvEqVqhaifSTYo dnDT8lOfw1Ge2F3nArA9XuY/gU5u/7ikUbSRVyDxLjte4pGlcvFB5yomqZpTlP4J7AGs +xHGDi1J8k6NET1njE3z5V7t0ViyTp/AuCEg6n/a+KsS0nFQxRZxHb+a5JpQn6MTl1xW pL/2BqAqHYK7trMEoKEoK2LpqUqm6wLzAJVlgaLg1lvXSIWg/GW9sbt2MqQk/MHA9RWn bGXQ== 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=rirvTla0dsA2WvDOoSLm/a9+OL4+51DIYEWLr53yvNY=; b=AWZ70u9niPWiENhvLezag5rigMDxyRGxtz6BiLB6fEMN3wpYIntLFGF86jcq4Yrmwz mg0lkUrlJOvdyyHxE30YYcWvOxdRNErmgduMrC0y0H8jg35nFzJfRGTEOG9t+e3mOuIi 7W6HAJcgGVkag6GEfIvng4sGJAlq1NAbQ13cKym28Wr4CCjCV+3wDySFo4miNPwnRzy3 TyjaIB9iLkG2MbCXYWS8IAs9T7RMN42G7MAXhPJ8s/xqP/5kbcaahF9yBv2aAf7nC13j 6do3r2txVdAoexgSLWzs8Q4nnyRb7ZSjEPny17M7oOsRV26BnThy5SgaYt+hUhSrXwfg df3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HyCa6O8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a17090a600a00b001c7ce042e17si3961679pji.83.2022.04.05.19.19.07; Tue, 05 Apr 2022 19:19:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HyCa6O8W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232643AbiDEHzF (ORCPT + 99 others); Tue, 5 Apr 2022 03:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233519AbiDEHrz (ORCPT ); Tue, 5 Apr 2022 03:47:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A7359137F; Tue, 5 Apr 2022 00:44:42 -0700 (PDT) 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 DA526616C6; Tue, 5 Apr 2022 07:44:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E67A8C3410F; Tue, 5 Apr 2022 07:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144681; bh=rZPmPB3ZdqS/cJV/EIQ6WDIET+faFfh7hNW1xBHPSc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HyCa6O8WjU9U/vu27ot+6M4qX312ArW3Oe+SstDyALKSZt2n4m9F10yA98ocKhsaY SMe5ydK5ShU12sjU4wLr8mtrFP89xMKarH2REd8fA20pZSNDciQKPQ/kO+fJ3LG+3U 3S+gR6bkNfteBcMTEtEb5dqGnfTc1lQxFkvB8qBE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sakari Ailus , "Rafael J. Wysocki" Subject: [PATCH 5.17 0131/1126] ACPI: properties: Consistently return -ENOENT if there are no more references Date: Tue, 5 Apr 2022 09:14:38 +0200 Message-Id: <20220405070411.422867282@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sakari Ailus commit babc92da5928f81af951663fc436997352e02d3a upstream. __acpi_node_get_property_reference() is documented to return -ENOENT if the caller requests a property reference at an index that does not exist, not -EINVAL which it actually does. Fix this by returning -ENOENT consistenly, independently of whether the property value is a plain reference or a package. Fixes: c343bc2ce2c6 ("ACPI: properties: Align return codes of __acpi_node_get_property_reference()") Cc: 4.14+ # 4.14+ Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -685,7 +685,7 @@ int __acpi_node_get_property_reference(c */ if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) { if (index) - return -EINVAL; + return -ENOENT; device = acpi_fetch_acpi_dev(obj->reference.handle); if (!device)