Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3329270rwa; Tue, 23 Aug 2022 02:59:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4I/UWXI/fXIIfmCqKOKqw7q3g01xIRkgbbGXCQVyV9JOKS1TACJbSfoyhcw1NUEflOjCyh X-Received: by 2002:a17:906:fe46:b0:730:ca2b:cb7b with SMTP id wz6-20020a170906fe4600b00730ca2bcb7bmr16351319ejb.703.1661248749158; Tue, 23 Aug 2022 02:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248749; cv=none; d=google.com; s=arc-20160816; b=tXUrHILWLlvFfq6C67tK9xbxrTAGf+O1IljDWaDBvVpDg9sr6OBKLhRdUrO6x++yAx wHoDx855fsFG4iZKwpyYsrdYP5hforj46yghvFRrSgx2YUd+Hy98ifjPDnVHLQDoZ5Gb dILJjfRZ7Yb1fyOkJyqZdtY1eJsE7GjY2kztlsyYOYJVv4qRfTcdqz64RKNi6QsmgDTd XAzm5HeEe/A6wvT9DpwZfKC2WAALimyTV/LoCOPREsgtijN764UFZuFUPM1zoyHdsYHS XrKfkQ3g9+8B9oa8Pe0FalH7rzKQFxYnVtHhhHBvsTcbTCRRuIE/iBUXwP61/VXAFzu2 GrWQ== 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=dYAxanBS89UcUb6eDH+7F1nC/iWodBsOxHcPACwB9PBz9db6V/Wzh0Grx4wiL9+xG0 3ZSnT7cs72KUZ1KcaPlDht09EvAB1u/xGbj45nxNGrU6zTmIJO136gp75Y5D7Ml5Ges8 5xdVk5fhSpcfTNVYg62Ps2KYhpukxUrwcvivZ07Gk8o/fojpdY+R5y9A0QR/FH7iK+dj s9EQCMQk/EzvOkUtlKOWeCCMSqkhlGHvUEna3yIqgACbxR2a5LJQAt0pG9LuPSRQ+YEj iotufcyBqa/n2xv9YaCX25wPuEpfHI77D8yxDByjqVb017PA/ZV0Vq5A/IzpLRgh05b6 Tz2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ig+Z7bXS; 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 qb24-20020a1709077e9800b00734bbe8d2e1si12124736ejc.545.2022.08.23.02.58.42; Tue, 23 Aug 2022 02:59:09 -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=Ig+Z7bXS; 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 S243514AbiHWJoq (ORCPT + 99 others); Tue, 23 Aug 2022 05:44:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352327AbiHWJlO (ORCPT ); Tue, 23 Aug 2022 05:41:14 -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 CE4917A760; Tue, 23 Aug 2022 01:42:03 -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 BE4C8B81C4F; Tue, 23 Aug 2022 08:42:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AA9EC433D6; Tue, 23 Aug 2022 08:42:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244121; bh=n+2iOGiB+qch6T//Hq81dKR36CGWfTGsY3B/xUddBgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ig+Z7bXSqc/w2f6asXBTYIeonnzw60P3qdYRP8tYmlKU2GfgFLUOuf9ft5bc2dSTR UWUwFmX3EU387236JTnfw2rYwW2Y4Ou3S5q0o5QBp+tvsx6/mN1c6oRxsm+dQ0wu8B J4MbLrAmLkP74PRxJOBgo4YTFgvYNp1wDH7QYtk0= 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.14 089/229] i2c: mux-gpmux: Add of_node_put() when breaking out of loop Date: Tue, 23 Aug 2022 10:24:10 +0200 Message-Id: <20220823080056.892342856@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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