Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2205616iof; Tue, 7 Jun 2022 23:10:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6IZW/IWUMBr1hTw5Y5DMNZ8Wq0oeMDI0k2e96INqoJX0vx9fMNo/j9/CCfeIUVstPX3/c X-Received: by 2002:aa7:814c:0:b0:51b:b3ee:6be2 with SMTP id d12-20020aa7814c000000b0051bb3ee6be2mr33140426pfn.3.1654668612249; Tue, 07 Jun 2022 23:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668612; cv=none; d=google.com; s=arc-20160816; b=r9jaqrO1liBkfnslHFmBM7ruFMaO3BwRYCnQM8OBADwiqKvTm88LtTDAT6w4c0Ddgg hsp2tA7FQU0D4PNosuBblCb1sJ69H4ianIJF9BACOefSRvtGnb7HhS54aVRdeXjo8AV8 T1eOnBzITPECwvQMtLGOEHDE3QANtgRNacreP3dRzmBk7Upoq2TIXu510qWe9a/OmKjN DF103phyDHcwzvKz1wtqwRo858P6UiQIiaYCe2XdTPeAw97ClHI3P6rAz/sS1sfdykfs 1orVplw1JY+qcK6KTuF/qdKhhagL/FNT8o1F/p7uHDpSD7+y9PCDPOveMr4jnn4FtYXh X12w== 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=OJg9ua4RGvzQ9Bm5gb/OLlhoZ+omQyN4yvelOiAPUik=; b=F3IRu0Fq2h87iYPZW1o5XVQX3zHKTthzhKCnNnGusg2O9z7vqQZyj2COPB/9wDvwiG PzcbARzmoUhadxbLU1yeXpN6ta0v7YcX058WwZKw0aL+6awH6lV6Fs+xL2fgIrUVXV4N mOZKhAtkV2Kl7QHyudvYRnw/0rnnebI0DD56xtfhPjB4Dgm7vNKZLBtjk8fTbenTtv2r EbnU0V4L9/Oqk9J6UphFz2MyiKfwjlF5UfDnyrE/WaIJncNoM1Fz3zRuVWcq+FpsrsiR FMYZ5K3AnJV8SK2J583MH+5OXx6io0nKo/V8IBM8WqFlXxrh36Xkf7jD0MxbpIJ9FN3H TV7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NsLRtBO2; 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 e5-20020a17090301c500b001617b60e734si29265123plh.139.2022.06.07.23.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:10:12 -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=NsLRtBO2; 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 21A2D4AA35A; Tue, 7 Jun 2022 22:32:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387662AbiFHBhg (ORCPT + 99 others); Tue, 7 Jun 2022 21:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381861AbiFGVpM (ORCPT ); Tue, 7 Jun 2022 17:45:12 -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 56DC3235137; Tue, 7 Jun 2022 12:07:31 -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 3980A612EC; Tue, 7 Jun 2022 19:07:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45D99C385A2; Tue, 7 Jun 2022 19:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628849; bh=j4qLntO3VaOtB7btRAveV4YpRZHf6JXJpBSgnbjuGuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NsLRtBO2RvLGT0cBL7r39fkwo8MZPlkytMHm3U8PDALXwZzeBY+ck5pEfoCSYsepR r5nTRj8/vYHDQXH0veDVHSP480C8s7pOAjuzaoTN3Ipyeg2TrOp6vuHyttTChG3P0y Kdw1/UK5zlEIhFFq8i8H0AL+uVR7i9LUhuf9vhYU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.18 478/879] regulator: scmi: Fix refcount leak in scmi_regulator_probe Date: Tue, 7 Jun 2022 18:59:56 +0200 Message-Id: <20220607165016.753275018@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: Miaoqian Lin [ Upstream commit 68d6c8476fd4f448e70e0ab31ff972838ac41dae ] of_find_node_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 0fbeae70ee7c ("regulator: add SCMI driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516074433.32433-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/scmi-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c index 1f02f60ad136..41ae7ac27ff6 100644 --- a/drivers/regulator/scmi-regulator.c +++ b/drivers/regulator/scmi-regulator.c @@ -352,7 +352,7 @@ static int scmi_regulator_probe(struct scmi_device *sdev) return ret; } } - + of_node_put(np); /* * Register a regulator for each valid regulator-DT-entry that we * can successfully reach via SCMI and has a valid associated voltage -- 2.35.1