Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2189189iof; Tue, 7 Jun 2022 22:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKuuRjXkS9IU5CbwGfBwXdEK0jCSkqXN0oFZWIv1uCu2P6sAgNp+HU1MMUriqb5RYFH14W X-Received: by 2002:a17:90b:4c48:b0:1e6:9145:513 with SMTP id np8-20020a17090b4c4800b001e691450513mr33192036pjb.227.1654666696305; Tue, 07 Jun 2022 22:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666696; cv=none; d=google.com; s=arc-20160816; b=ULnTmiVF0/eJ7kwN7YzFHsth3d/EDrES49A7zByFmlf83ioDYzhC4L53CkfYHIgLg4 DKTQwPFDTqmoSfB6W6jv4kaaelgdxWu+cwKZjRhEwKCndsLVKkt9E151N9rfWcBnB4rS XOsrPSwz0AVtpI7ZzLuP3lhYhH8TTmw+c4Je9QLWEiRpEQ5xXosleF1DlppwuqU2fC5g 7gSGg1qCMhCUvde+dWgzM9x/sKtu768yjvCZiQ6aHeuYw33hc+lyt/emR4Ptyvtau+z5 1AhYJIg4gzAuAY1EHEStW9aVAwCqptKFYf+LDCTNTLZLcF4gyid0j+zdf6TGlEBlnGH0 IqNA== 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=EyJsDOnyiaG8GnrPFbyPUJ1R7UqZ91WSeA0JkMgXvEE=; b=hrmNkRZOPEbTN0EFTCbXhtzc2PT0G1Bzy1gjxzpRnnk/Uh3Jv6DPNDndcWQX2NgSsx v+Yx6nal0cRqJ6ANGiQjy0DzcEKYpsgNSfaTCwpQqXXNVjKlTK4GlgFJkPJkWRroVudP 0EkphaAWZijH7EpNsCZoYBQvUGPA4FI1ihTkxjTBJujudyx10f/mvwHZCOFWMfs+i5W5 QsdD29x/sxP8QTX2nr36Rfq8wTiWXnOBCpVydF8UsJIt4CiXuw6+0ehwahzRUlrJdNjg DsoXiYJhQ1aFsSKmE7lf/c2T7vWlgRZwJNtWUPEugcesypfnDbMTE+SjICYUDpNTWuJt LjwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jrxBCRN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lx16-20020a17090b4b1000b001e34176705esi2332424pjb.95.2022.06.07.22.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:38:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jrxBCRN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4EE56495067; Tue, 7 Jun 2022 22:05:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349082AbiFGRzf (ORCPT + 99 others); Tue, 7 Jun 2022 13:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344963AbiFGRgn (ORCPT ); Tue, 7 Jun 2022 13:36:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF7CD15FCF; Tue, 7 Jun 2022 10:33:06 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3ABAA614B2; Tue, 7 Jun 2022 17:32:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49DFEC385A5; Tue, 7 Jun 2022 17:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623166; bh=74YDxV6EJGzw+ERnYDk+S6R0DQRX17U16pYX5RQMFaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jrxBCRN077odYv+PIJlegGHUXJeOzmcKmQsTb0uhSNtw3mMXvAzaLuPoLa5SmZjVH VIESUbWBtXbkENr0tNSNK1P8pdf6ceWfTGLZlnpU+494tfwMZRcoF3MQoDF90GOHUv y/NXS8tf+VVZCVWPDzj2iqhUPjI8TB1gWvfiOTIU= 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.10 318/452] OPP: call of_node_put() on error path in _bandwidth_supported() Date: Tue, 7 Jun 2022 19:02:55 +0200 Message-Id: <20220607164918.034405219@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 5de46aa99d24..3d7adc0de128 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -346,11 +346,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