Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp573395iog; Mon, 13 Jun 2022 08:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM2tu7Uevi9CJpiZSvK70IYhTO+rGueRMwC9lM/lS3iG1KjFzaC18rY0rkhYfnP42lax4U X-Received: by 2002:a17:906:74d4:b0:715:7c82:1aa0 with SMTP id z20-20020a17090674d400b007157c821aa0mr377263ejl.138.1655133805738; Mon, 13 Jun 2022 08:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655133805; cv=none; d=google.com; s=arc-20160816; b=hsHbi73jQm3BMpuGUMgzYA4cfHxr6pj/guSefAAJQpH20/c/iPa6eKnpwEFl8znrzq Pd2y6CKNVb6R5xrif4ax9kHhCyiCH2tc8XFI8V8s68oozjFZOuLPj+qyBAOo0wQREVTl 7nVTqTJWVtVc8dixA1qQdPmwlSPkvq/1KJTgf4ZUDMX7R29RbtPXh1A131GJyq8lp5iJ 6+D1nel8ECcOOZLF4672UUoWGNCagO73UMkxsYVj428TIzQyrvCmbW7YrJZ0HSJzBov9 vzzCvt1nFb9lTynu/csB57A/DYkS9Mcnzl8z5OMjO73AkNJ1B+7QeoFbGZIKt4ggdoCM C5Nw== 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=/+BQEUfsAbfVElH0Fh9ywcJ4YPIurRzjbqQW0wDW1e8=; b=bnQNOhxTH8vqBkA1DZpOjZ+eGHpUeRK7nWWbHoOPlvPwT5ecSdE06vVSTvZWEPkgQ3 Q47+wzx347uRQlpS16duzlEcqQSMPiAn7ISr1JWieIe81de3imXCcuEd09OvwobJxdZ4 OqyEfv7AyC6upK89dXSv8lxgvITIo3bAtvlmlpq5Jacqk113teUY7EmB3/z6Dr22tIfr EotxZ18lupO5ZZ/bJrZf23pEE6Ba0/YGHEq4TcXbdOMD29AoCxUsjLGAjLk631suRd4u MXWIzoNLlAFewREMVVERpMj0wn7mUiBpBj4/NdCHD/eGDmm2ahHVNlre45yYestYF18y HKMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jlTD+kqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z27-20020a17090674db00b00711ca15cd1dsi7359229ejl.180.2022.06.13.08.23.00; Mon, 13 Jun 2022 08:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jlTD+kqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S244172AbiFMKrY (ORCPT + 99 others); Mon, 13 Jun 2022 06:47:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346818AbiFMKns (ORCPT ); Mon, 13 Jun 2022 06:43:48 -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 6A85CDEF6; Mon, 13 Jun 2022 03:25:02 -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 1F96AB80E93; Mon, 13 Jun 2022 10:25:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73505C34114; Mon, 13 Jun 2022 10:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115899; bh=9c7Ltc9W92l0eI8ZSKU0UekWtx57C7sgrsXJyiyANRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jlTD+kqqHzQrXQfR0/rdWX+XmyQLoiofTAO6qhhgbvjmwO3XXukR+gZDVW94sTASD sKyY+tpy/qTBKDWOCB2w8ptwsyxdXhJN0xtGXVbYNshyJxhNajOaS6PvQfUcf0UB9D duYF6Nsg7sA8UdD1Z7r5x/hxJjYhugmCC54HidOI= 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 4.14 071/218] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt Date: Mon, 13 Jun 2022 12:08:49 +0200 Message-Id: <20220613094922.357559971@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 4f205366d8ae..587a6bf9037b 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -431,6 +431,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; } @@ -455,6 +456,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