From mboxrd@z Thu Jan 1 00:00:00 1970 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 3049FC4321E for ; Mon, 24 Jan 2022 23:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2365847AbiAXXvt (ORCPT ); Mon, 24 Jan 2022 18:51:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376814AbiAXWz7 (ORCPT ); Mon, 24 Jan 2022 17:55:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22772C0698C1; Mon, 24 Jan 2022 13:10:26 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id BC29BB80FA3; Mon, 24 Jan 2022 21:10:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDA15C340E5; Mon, 24 Jan 2022 21:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058624; bh=hPhM26oCQNd5VfkDgqvT9SQOy2C1lCfjkGP4zmnbAwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l2I9JPLuLvNwN3R4CAnPMN78DOmL21PUxUJIurO4A9XFY2J6W+zZhgMNW4DD2wr6P c8SdAm7T3FQKpSu6Ssobpd0dxwACeQW6DOUba+yZDR67y48HYxrTVUmhkdTQWnTTsI kAE/Qsr0GDih8an4sH4NlOK+kWBWUSu1C/4sccrc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Sakari Ailus , Daniel Scally , Heikki Krogerus , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.16 0350/1039] software node: fix wrong node passed to find nargs_prop Date: Mon, 24 Jan 2022 19:35:39 +0100 Message-Id: <20220124184137.054641625@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: stable@vger.kernel.org From: Clément Léger [ Upstream commit c5fc5ba8b6b7bebc05e45036a33405b4c5036c2f ] 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 Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- 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 4debcea4fb12d..0a482212c7e8e 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) -- 2.34.1