Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2300154iof; Wed, 8 Jun 2022 01:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwjU02us5C3gEdISgNEH5XoAK60OLSmOUgScBC4yhb3llO5bnuVaBvjBnsP+aoSBCMHLQj X-Received: by 2002:a17:90b:38c2:b0:1e8:747f:a13b with SMTP id nn2-20020a17090b38c200b001e8747fa13bmr18653234pjb.166.1654678343232; Wed, 08 Jun 2022 01:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654678343; cv=none; d=google.com; s=arc-20160816; b=oFw+pQ/AGnlr4I/5gTRCw3I/493JVk5QvoEBKppt4LDfKXK7bLOz9uY7lVbX+fj3mU 3qmHEmUTSkSYa9BT0BT1hpehOPw5roUL6iindk9NvTACjyn0/qLyledfzW0f/GQE46n6 77sHtJrTT1fqE8R27g64/2+PfYTkU8V8hPT02OZp5XDn+Oj+SReS26qbY8z2LbpxQkhK NyEGW6e/ABQL0x+Pqo43QRhFRtw0yu4RxpzSXEAkY66p/HYpOwGtx8KoUoJK3N2+I0Pl fdIV+oRYTQiNPjCfYCkSpkNywbJEguXCrnQe8dubYRT9+f1F9M62FBYFrRhfcXS4lUEN YvTw== 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=OZ7HKj/NVIFDaZLltfzFbwwCXL7abVvVtQjxEywBMvs=; b=dmgIrS2qiYYInivPfLxRGtmCfaH9YwOfXBqhnqp2TYI6vkfrMxmlQoeVqx9AgccusZ BK/mH1zk7EuDGI5yKYr3Jx7AOG1j0G6aUsvZm4JK0nBQA4sKQxd+HZZnIIb5R5Qw+aXM EOtHjQQ+GHHUL0VD4wqylZoZ5WyYsaD+kyTr8Zt+VxGoarrqyKRXWcsXjy/OKddeDDyc xoxi9J9DoKAcs6aGxpcilpklHKoMDt9EcdAnTMu1iQRWNQtDGl8lqLGvA6Mbr5oPzz7d pZF3LeRFyqpk8aWHRnjLsvQqlpbXf80J1muZHvB/HTR7KYz3GE4b17jdtQ3vaHV91Gy5 kpng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hzKV6qqP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d18-20020a056a00199200b0051b9a06306esi6507859pfl.168.2022.06.08.01.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:52:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hzKV6qqP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EBCD6394BFC; Wed, 8 Jun 2022 01:15:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351125AbiFHAsx (ORCPT + 99 others); Tue, 7 Jun 2022 20:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382792AbiFGWEh (ORCPT ); Tue, 7 Jun 2022 18:04:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C688250694; Tue, 7 Jun 2022 12:15:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id 0AF63B8233E; Tue, 7 Jun 2022 19:15:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60256C385A2; Tue, 7 Jun 2022 19:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629342; bh=h7iFGRANW2OaT8ExBuyx2KGOZq68ixyMEhTw8ubdLHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzKV6qqPdXAZMIc2zU8F+v/U4MBew0o3VG69P3b1uRnycSUwXKtMuKC1p9rBrSpZx MtoAVbbfG//hnUsBnvhhgEBE3FOg6nZZRXlxBl2FoQ7mnVRqxwRWHP6qhMOX16fCsM osI45tiuCIoqZ5ZMKC7sATq09vOzCU+G1KW39Nm4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Viresh Kumar , Sasha Levin Subject: [PATCH 5.18 657/879] OPP: call of_node_put() on error path in _bandwidth_supported() Date: Tue, 7 Jun 2022 19:02:55 +0200 Message-Id: <20220607165021.915516608@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Dan Carpenter [ Upstream commit 907ed123b9d096c73e9361f6cd4097f0691497f2 ] This code does not call of_node_put(opp_np) if of_get_next_available_child() returns NULL. But it should. Fixes: 45679f9b508f ("opp: Don't parse icc paths unnecessarily") Signed-off-by: Dan Carpenter Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/opp/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 440ab5a03df9..95b184fc3372 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -437,11 +437,11 @@ static int _bandwidth_supported(struct device *dev, struct opp_table *opp_table) /* Checking only first OPP is sufficient */ np = of_get_next_available_child(opp_np, NULL); + of_node_put(opp_np); if (!np) { dev_err(dev, "OPP table empty\n"); return -EINVAL; } - of_node_put(opp_np); prop = of_find_property(np, "opp-peak-kBps", NULL); of_node_put(np); -- 2.35.1