Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3705496pxb; Mon, 24 Jan 2022 15:54:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAPerRfBd0xE07yvGMXYn07mXUztPtHTQeHm+ZMA0mMCXD1DPtkkZvtkJvGet4bjbm4V7Y X-Received: by 2002:a63:41c6:: with SMTP id o189mr5221297pga.613.1643068467114; Mon, 24 Jan 2022 15:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068467; cv=none; d=google.com; s=arc-20160816; b=J8trYnpEIGxSI1bTjms6px3o04TRZLl4pRjiYt6PILGGpD5C965Mu/ZvvJc5vPNo8R VPvHR/N09Dikyd11bcSO37sKb/l9yu/d/ufdwAiwwd3RXpP7Px1NNqWQ7a+lTQkaQJwG BUg2JYCw6jX75FvMjlL9urlakmPWcFzVtGQNkLXYV06+yJ9W7Aug15bDekF8VuZ6Vxas pPomumjeGeLzmI0jg4/tfAXThpKg4ymETCWgZhVW75Bagvl1jos9GPLavKOw1WMR3nLf Kh4vIxMn1bio735+xts8I1nDJSHzBi3j79G8kGsyTv4QWQOjTcc1LiMGoT/GlqYpVJil xTjQ== 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=N4JF+xlHxlAku42loP8QYoMNSLYf6IvTlDncqsqxqRg=; b=qmAVSYbTs8AdOFfGM4HINh4Ojk7lG55ZZnxP/4eJHqiciULoSbjGNgoQ9ZxQ8q3d/G COx311rYW+VFWA46p1OzIAWTrfvF1iVEU4Rxt5hQh7Si6jaT2jT01cqBWz7TGCd5MMIr Y8n/3sUtpjIUNxfi9x9TVBIK8lsASI9vGXcVS28d8LRaScqBWVNXrDDEvHaHY72uEXxr KQgumL/Mh0ioAd1rIglqWG/RMa/Y7oRvwv/YX3C2EehnG3jEyEayT5UclTObDfUFZnb3 cJf40wENZti22Inue8HOIHXQGyHUZSLqtiTtRZJuyODx8M/iK3CCrlJF75MStw3RCmqK GjEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l2I9JPLu; 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=pass (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 o10si8090401plg.153.2022.01.24.15.54.15; Mon, 24 Jan 2022 15:54:27 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=l2I9JPLu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2364177AbiAXXqz (ORCPT + 99 others); Mon, 24 Jan 2022 18:46:55 -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: linux-kernel@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