Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412969rwa; Tue, 23 Aug 2022 04:29:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZKBXjidDw2Liyj1jR6cj91U63fXhAe6LTaM7GjaKGOznX/LmE73QL1SaGNdTsYB0RYgr3 X-Received: by 2002:a17:90b:2114:b0:1fa:f716:a426 with SMTP id kz20-20020a17090b211400b001faf716a426mr2870210pjb.19.1661254152487; Tue, 23 Aug 2022 04:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254152; cv=none; d=google.com; s=arc-20160816; b=u0hTXf2wqbpuQ5Z4BFd9dKqo8rk/gsg5TBT/xrsWSzQYiT6AEcfhSi8bZhFJrw942m KfY7VQRFYl/vDc+7nnIPv5fR1r/+EJIdb8nWYDfHm9P42ASITQX/JA8pWkcb2NOzcG7K Dn/u0hCc1a5YExasuv8MVdH5q1G0nkOJivFRkU3DNHomtcYY15DjGGOGniCrW5Y+qIEc WdSE8gsPjxuchLaFGVIDfY/xTkQ6xHrccQ+BXf2Pe8oKnOwphTW9pA27Z/YijbJ/viSa kX6j+Y2kNvxS9Yt+QQ4lsjW86243Sf6G0ZQPflW6WZazpwVOiNYoxtrruFyWhtfql2cb ujbQ== 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=DzEL5RcN+yzIJniQVS44HWNLkZeb2aoiPxGIdZu8xkE=; b=R3ppG6KaxACfbfdftiAPXvowQX7mb6gJfbLQOHyRwz+e/BFg2zx1NnB0OSe+DDRvwz cjmctpROADB5SD1ymK54jObKrXjWCEzy/osnHhQZopNAHDycFakrwS9kXDKg1Q9vpDGf GNsohXi6FZ6LY1lUGtZTxtCs3vMDEjQ88VRgmUMUoHSkKvdailMspJFlNlcdrkAehaa0 MoVSV18m1qgMde6Cg//Bydf31hoT/aJaMY+xPNa58piZ/x3R6gZEr5hIlopY2IzEgQnP BpXRpbo7BT07Ibdj0ILzrvwkRXviFk5v4PIKE2LUFKja+5E0UxKaD2a/quK8IvbQUM/W GgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="D/nP/gpT"; 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 t70-20020a638149000000b00429c526b398si15110669pgd.484.2022.08.23.04.29.01; Tue, 23 Aug 2022 04:29:12 -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="D/nP/gpT"; 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 S1355808AbiHWKob (ORCPT + 99 others); Tue, 23 Aug 2022 06:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355625AbiHWKgp (ORCPT ); Tue, 23 Aug 2022 06:36:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D460A6C06; Tue, 23 Aug 2022 02:07:11 -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 13AA5B81C53; Tue, 23 Aug 2022 09:07:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58804C433D7; Tue, 23 Aug 2022 09:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245628; bh=n+2iOGiB+qch6T//Hq81dKR36CGWfTGsY3B/xUddBgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D/nP/gpTSxmeyyVpJeFGWpFPo1MkxUQnSCXFIzUtPmaFDrtd15+B7P1/8E7fjK7MY FQZzOctNCbCXFr0CQRASEjB+yYpRwatS6Wj/DMAfdofZHXa6RpOuqhzuoCLvB04fTp 9u6Sz7W+BGP1KWcW1kpUYeomMFhBY+EaQyvWdnaY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Peter Rosin , Wolfram Sang , Sasha Levin Subject: [PATCH 4.19 106/287] i2c: mux-gpmux: Add of_node_put() when breaking out of loop Date: Tue, 23 Aug 2022 10:24:35 +0200 Message-Id: <20220823080103.950950070@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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: Liang He [ Upstream commit 6435319c34704994e19b0767f6a4e6f37439867b ] In i2c_mux_probe(), we should call of_node_put() when breaking out of for_each_child_of_node() which will automatically increase and decrease the refcount. Fixes: ac8498f0ce53 ("i2c: i2c-mux-gpmux: new driver") Signed-off-by: Liang He Acked-by: Peter Rosin Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/muxes/i2c-mux-gpmux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c index 92cf5f48afe6..5053f1675a29 100644 --- a/drivers/i2c/muxes/i2c-mux-gpmux.c +++ b/drivers/i2c/muxes/i2c-mux-gpmux.c @@ -141,6 +141,7 @@ static int i2c_mux_probe(struct platform_device *pdev) return 0; err_children: + of_node_put(child); i2c_mux_del_adapters(muxc); err_parent: i2c_put_adapter(parent); -- 2.35.1