From patchwork Mon Dec 20 21:05:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 12688547 X-Patchwork-Delegate: rjw@sisk.pl 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 34C98C433F5 for ; Mon, 20 Dec 2021 21:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbhLTVG1 (ORCPT ); Mon, 20 Dec 2021 16:06:27 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:52165 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbhLTVG1 (ORCPT ); Mon, 20 Dec 2021 16:06:27 -0500 Received: (Authenticated sender: clement.leger@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id E9E26FF805; Mon, 20 Dec 2021 21:06:22 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Andy Shevchenko , Heikki Krogerus , Greg Kroah-Hartman , "Rafael J . Wysocki" Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] software node: fix wrong node passed to find nargs_prop Date: Mon, 20 Dec 2021 22:05:33 +0100 Message-Id: <20211220210533.3578678-1-clement.leger@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org nargs_prop refers to a property located in the reference that is found within the nargs property. Use the correct reference node in call to property_entry_read_int_array() to retrieve the correct nargs value. Fixes: b06184acf751 ("software node: Add software_node_get_reference_args()") Signed-off-by: Clément Léger Reviewed-by: Sakari Ailus Reviewed-by: Daniel Scally Acked-by: Heikki Krogerus --- drivers/base/swnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 4debcea4fb12..0a482212c7e8 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -529,7 +529,7 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode, return -ENOENT; if (nargs_prop) { - error = property_entry_read_int_array(swnode->node->properties, + error = property_entry_read_int_array(ref->node->properties, nargs_prop, sizeof(u32), &nargs_prop_val, 1); if (error)