From patchwork Fri Feb 25 23:14:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 546167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADF64C433F5 for ; Fri, 25 Feb 2022 23:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235599AbiBYXO5 (ORCPT ); Fri, 25 Feb 2022 18:14:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbiBYXO4 (ORCPT ); Fri, 25 Feb 2022 18:14:56 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 375AE199D74 for ; Fri, 25 Feb 2022 15:14:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645830864; x=1677366864; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ytu+QcjtppYEy8kkU9ah/HdFDSFEgni4rTrKUJ9n/6M=; b=i+ytY2FP+02zULME7UeaDj/KsZpszolO58mV86Q5svL8pCr8s3DBqu12 1G2+C1H6CrCyOiQhO01JwvuxQAyyD8UmYAhUdq8pV1/H53sMIymgbAMan 5jEUB1uaBBVgAOVpNwngvwOfMCPxfU5Dhj3jKgt3fJiaiq953m+P+5QxO APL3uYujpRfdkSnMRCSIQShAQGugBhAzjOCI7yBZpOGp3ldvlbXhOL4yG 86FLj1rU6Hwkp51goyUhNXlA/FAHY4oO8SL7BxBbZMcGJiAE3h6cKL7R2 /2D3hh4XwM7fgFhRAdKPnHnh67fY25y5f3N6hwIbzuRse/RzHq4djYQQe w==; X-IronPort-AV: E=McAfee;i="6200,9189,10269"; a="250179675" X-IronPort-AV: E=Sophos;i="5.90,137,1643702400"; d="scan'208";a="250179675" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 15:14:24 -0800 X-IronPort-AV: E=Sophos;i="5.90,137,1643702400"; d="scan'208";a="544195989" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 15:14:19 -0800 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by paasikivi.fi.intel.com (Postfix) with ESMTP id B72E4204B1; Sat, 26 Feb 2022 01:14:17 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.94.2) (envelope-from ) id 1nNjnY-00B80d-2Z; Sat, 26 Feb 2022 01:14:52 +0200 From: Sakari Ailus To: linux-drivers-review@eclists.intel.com Cc: Pierre-Louis Bossart , rafael.j.wysocki@intel.com, Andy Shevchenko , "David E. Box" , =?utf-8?q?Amadeusz_S=C5=82awi?= =?utf-8?q?=C5=84ski?= , =?utf-8?q?Ilp?= =?utf-8?q?o_J=C3=A4rvinen?= , Sakari Ailus , stable@vger.kernel.org Subject: [PATCH v3 01/18] ACPI: property: Always return -ENOENT if there are no more references Date: Sat, 26 Feb 2022 01:14:34 +0200 Message-Id: <20220225231451.2652330-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220225231451.2652330-1-sakari.ailus@linux.intel.com> References: <20220225231451.2652330-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org __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: stable@vger.kernel.org Signed-off-by: Sakari Ailus --- drivers/acpi/property.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index d0986bda29640..3fceb4681ec9f 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -685,7 +685,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode, */ if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) { if (index) - return -EINVAL; + return -ENOENT; device = acpi_fetch_acpi_dev(obj->reference.handle); if (!device)