Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2097367iof; Tue, 7 Jun 2022 19:38:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrf86rXqakjKu0uF7L+vpGsoHqQGryxvaENp0EfKhxvZOQoaL8Vl/Ar5ZhbXuRbpDGpwWY X-Received: by 2002:a62:f846:0:b0:51c:17b2:60de with SMTP id c6-20020a62f846000000b0051c17b260demr14196316pfm.76.1654655892981; Tue, 07 Jun 2022 19:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654655892; cv=none; d=google.com; s=arc-20160816; b=N/+MKXJnamVk8nbrZplgY8T8ngwMn0nbLrrN0W/bR39fMLknLq7DrFThDNN8xWFtcq 8L+572s9yfyt8u08cCMGzDdkIAzz4vjxRGQ+lox8hONHWkFU//j3H5RByzUwytsqj9mC pdiEE+OoRwenhmVMUjtF0jv/jD37v65Ix/0o295gR+6YJFtvjYQSWOYlj0NAXmCl344I dNRUycf2XMznBACSWvSBtFWIpkojPCVJcJcQjLs7MOrL+/tlJ6Ud8GWsP72796AZKk4m DKiypOjRdQwBtZlyJ6voN7iUlRaR159iIEkHMex1OVZkKlGJ81Mre3wRN/APfJuVxbD/ nzIg== 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=tqO7L/ZD49C7hIgIzrjJ1aaBqT6tTWH8OA/CIGrX2oU=; b=xayU9oc7noHAg7M7raVQJYcF69QI0d1y9/DuuVjzcHRJ9a+QldLLvyi/Cb02LyxUJ3 SoXRtNedGrG5z7YvIwwsYjPXuD+YtPwlv/WvMzZ4mRRowrjD75YZ4BG9j1YnukCWi7FX 4xfCexk4VClHpRppCSUuV48uviDddKnTsFzIWW38QQU/VDG6xa+IvBVouhKcpj35UCvd ueju8UDycA8Nh0AtU10zVoHUEqJf4PFjct5wznj6fqTr56O1zaYMp/llLR01JwrNp/zp TvIHKOLelvgvgBwpsmyMDfwW1Stk0ovoj9uJXDFhZIKJROawlkRNkyyrHMsExC+eqDFy KcKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dJohvddY; 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 d13-20020a056a00198d00b0051054f9373esi28490231pfl.165.2022.06.07.19.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:38: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=dJohvddY; 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 8DDC83E9EFE; Tue, 7 Jun 2022 19:27:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386177AbiFGWsV (ORCPT + 99 others); Tue, 7 Jun 2022 18:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381319AbiFGVk1 (ORCPT ); Tue, 7 Jun 2022 17:40:27 -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 D51AD18FA73; Tue, 7 Jun 2022 12:06:44 -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 7F37BB81F6D; Tue, 7 Jun 2022 19:06:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA1FDC385A2; Tue, 7 Jun 2022 19:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628802; bh=Wv8LqfiVahQyHFgoG9Vecq8fraqBk8Ym4cTjhUqnw5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJohvddY23ijjM2B7zc/9kZ4T5kP89JzAKdoTFifnd08YIFcgnvclVAYcD1chCSsj YxlXtxrJZw2Bh4HAOP6k+4aJUtXrNDhI9JBGt6N9LvyuIEDPAP4FEiRM3jUZUwT04y ZUXtGpBU1L/Oy+eir8z10iyyEXXIN27aeYdBVXD0= 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 420/879] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt Date: Tue, 7 Jun 2022 18:58:58 +0200 Message-Id: <20220607165015.054490266@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 afaa7b933ef00a2d3262f4d1252087613fb5c06d ] of_node_get() returns a node with refcount incremented. Calling of_node_put() to drop the reference when not needed anymore. Fixes: 3784b6d64dc5 ("regulator: pfuze100: add pfuze100 regulator driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220511113506.45185-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/pfuze100-regulator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index d60d7d1b7fa2..aa55cfca9e40 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -521,6 +521,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip) parent = of_get_child_by_name(np, "regulators"); if (!parent) { dev_err(dev, "regulators node not found\n"); + of_node_put(np); return -EINVAL; } @@ -550,6 +551,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip) } of_node_put(parent); + of_node_put(np); if (ret < 0) { dev_err(dev, "Error parsing regulator init data: %d\n", ret); -- 2.35.1