Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3083850rwb; Mon, 15 Aug 2022 17:44:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR7IOfKz8hRiJHHYdGdwSeuI2SQMeCYz2VbE/J1UNYc7WlYTcTcV2kpZ0z/oE9lbI8Mx6hP5 X-Received: by 2002:a05:6402:287:b0:43c:c604:addb with SMTP id l7-20020a056402028700b0043cc604addbmr16630442edv.201.1660610642532; Mon, 15 Aug 2022 17:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610642; cv=none; d=google.com; s=arc-20160816; b=NezqEPS3Q+MsSK3+g4WOIXGRfMKMcKCIhUAsiVMJuvFcnI/TeN0TzfMHrHG9W0vA6b s79k6vz9yMiW1JrSTRk754Ze2rsMH6D8Y3MX3d3u70pJ1oGEuBzp+U4KZQRxj/PqSnb2 5D3y/NMGDPoby4V840zybVf0H9KG/Y/t6XwltgwsNy7XxP4kB9ZzSJ6ptKuB5rIMTcii TbCShaqpFPKCZAbwCanhWGR/lzO8pqJjalYF3QKnWd26LWXyKvYcjy/6AQy/o3kHXLVl XwKcqJpH1QlrG372XeUFYCDBU4Wzwjg3T3DwwOAgx993Pp8IUDIiRdskSgn137LsQqxr RdGw== 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=e1U4t06N+L15DRXZodAr86b8KhT1tlPe6Rz62hYlsAw=; b=q7fL6DWUAubd/4+PbEH60IalqO3bndjBFy39qmFc1du0VKeHi7gUISsrFpiw0lP7td 6xDsMTEqytSFKeIUjPjMjoxSNUGtBKUGOTK3OXpcpTkRQJrksOvLkVMjQX4dvHdBaCZP C9mmRjBQsZjIj4BHHI0c863VSNBpwGZypJL3i6KDAMCAAQz/sLUVe/jqleQ9nWNQf5I9 qdZ+2aVw0HhyP7KC6IGS9jZAwdZwLWvTsEW2+TCrNNtQBWo6Oer0cYhOYV72rotX8Npp tJeKyeA59+Tsb7DDmq+9iGO3yPBDF22y62GsSVO3J8gjx2PNTerbYyG/dhOkLSj3aYro tLOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XfTeq2jJ; 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 oz11-20020a1709077d8b00b00730869f1d14si8796205ejc.778.2022.08.15.17.43.36; Mon, 15 Aug 2022 17:44:02 -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=XfTeq2jJ; 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 S1347896AbiHOV03 (ORCPT + 99 others); Mon, 15 Aug 2022 17:26:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347040AbiHOVSO (ORCPT ); Mon, 15 Aug 2022 17:18:14 -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 5B73265AD; Mon, 15 Aug 2022 12:21:50 -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 ED1FC60FBE; Mon, 15 Aug 2022 19:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC474C4314C; Mon, 15 Aug 2022 19:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591309; bh=GOWshVnBwy6EwloCgplMH55chcLT2EZdBYc4L1saBCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XfTeq2jJFPTFIUAMLVS/ctPna2m2hbMhDIKB4Uk3iUvFRQpeV6gWlUZKJAJvIIhqP AG64X8uD0dSIN5SlWzBfDdqaRfOu6yt71IQB8eKZM+67DrhgFomGw7StSkG7WypGqe SF5PY5o4GD40czq4dY9hz2HabZlRH29XZBaak85g= 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 5.18 0504/1095] i2c: mux-gpmux: Add of_node_put() when breaking out of loop Date: Mon, 15 Aug 2022 19:58:23 +0200 Message-Id: <20220815180450.377517216@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 d3acd8d66c32..33024acaac02 100644 --- a/drivers/i2c/muxes/i2c-mux-gpmux.c +++ b/drivers/i2c/muxes/i2c-mux-gpmux.c @@ -134,6 +134,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