Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2924328rwb; Mon, 15 Aug 2022 14:09:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR5IggZeHM55JQAypOh7H6RMjlvEXppW4nZ3dwFh4QJ+tk4vWzRlhV0X5ifvghPepfUShwZI X-Received: by 2002:a17:907:7245:b0:732:f72f:44e3 with SMTP id ds5-20020a170907724500b00732f72f44e3mr11030196ejc.503.1660597757482; Mon, 15 Aug 2022 14:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597757; cv=none; d=google.com; s=arc-20160816; b=jFEXP8NVxFhxSvNd2UtgypRDfZJCG/rhVrHNOulw4oTw7vM1WJpjqSTqYY06OTNi4A dYveHFwuvwGon1oM6jjmkoeFLh1VHvRkQkHjdeCbCAV3mXUNVL5Xt1YpkPnSeN1c+Gpx vLXaFPqLK9VLlI66sg3GE98peUetZtZZEDQRsUg6YPS9xajVn/FDbBVVMwATOS4jlfkC 08/s8PPcKvbZr6L2InZNhhtTtFUgkqIwp+Xkjmkom9ZVDz/glE3R+n0r8YRpeLgmlEFc PvoL5GqPhJfPChM0GrHM8o3vUVSO5k5KLxtaKt9WZPKNfrLqXkiRTJTmXBD6LmSKAtsB KitA== 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=otzI1QM3juckosMCkABwhspM/wS++oNEQOqDCG/KTBU=; b=rxWUVi4szwDaJzF783KlQPvxB2RfIKri0tNOD3wSQuyKY0bTNhj16c9DayXlWF3qfx NxMczrW6SamtheaIPEVX9NFpWtQxC5pTehH8xSIKBtFiA0bVawcL5BGf43h6N+/iin40 xiKoSy0uC+ScA08rejkdgiTEsjWlnKwLcOvVmvnafGBQiB+JJLUzhK1nmOiM2pXUY+BQ ABdhb3XYeU8cUzBC2yZKUBN+SkXS0mPQaswP7NmwMXbT0ObHspl2T90TS88b/NrDxHAV vF4UJwuCJbR47sIO5AED0dQPEHrBCzu5k1iRvF5sAEuc02ZGfDra+/hPY2c9zAsNOp/i IToA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XlAllnD9; 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 sa25-20020a1709076d1900b0073069573e2esi7906073ejc.667.2022.08.15.14.08.52; Mon, 15 Aug 2022 14:09:17 -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=XlAllnD9; 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 S1344070AbiHOTi1 (ORCPT + 99 others); Mon, 15 Aug 2022 15:38:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245510AbiHOTdt (ORCPT ); Mon, 15 Aug 2022 15:33:49 -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 38E9424B; Mon, 15 Aug 2022 11:45:14 -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 91898B8105C; Mon, 15 Aug 2022 18:45:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCC74C433D6; Mon, 15 Aug 2022 18:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589111; bh=9aFWhDb0sLjSYCbmI8Iu1nyBKM24DyHPC+Y0uMpBoEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlAllnD9/w6QbJYCgNaAvb9rj3nDdGwdFbhkWRuVMnualxhCXHzyosqBCDnGsLHKp eQBpjdfI82Cu1a+L8MeIGxV7JovSYe5+zewX8EqGw7i1+/w6ZFBqungz+xOqDqBute Kvdj+B6ReVIZa1mwe6UGuQUSVImH1GaKn4PrTUZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski , Lee Jones , Sasha Levin Subject: [PATCH 5.15 616/779] mfd: max77620: Fix refcount leak in max77620_initialise_fps Date: Mon, 15 Aug 2022 20:04:20 +0200 Message-Id: <20220815180403.700238951@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 1520669c8255bd637c6b248b2be910e2688d38dd ] of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 327156c59360 ("mfd: max77620: Add core driver for MAX77620/MAX20024") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220601043222.64441-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/mfd/max77620.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index fec2096474ad..a6661e07035b 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -419,9 +419,11 @@ static int max77620_initialise_fps(struct max77620_chip *chip) ret = max77620_config_fps(chip, fps_child); if (ret < 0) { of_node_put(fps_child); + of_node_put(fps_np); return ret; } } + of_node_put(fps_np); config = chip->enable_global_lpm ? MAX77620_ONOFFCNFG2_SLP_LPM_MSK : 0; ret = regmap_update_bits(chip->rmap, MAX77620_REG_ONOFFCNFG2, -- 2.35.1