From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F03FC07E9D for ; Mon, 26 Sep 2022 10:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234672AbiIZKnJ (ORCPT ); Mon, 26 Sep 2022 06:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236352AbiIZKlw (ORCPT ); Mon, 26 Sep 2022 06:41:52 -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 5063954676; Mon, 26 Sep 2022 03:24: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 CEC46B80682; Mon, 26 Sep 2022 10:24:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12033C433D6; Mon, 26 Sep 2022 10:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187851; bh=BCpkiBVWoBhmhCQEKe8gIQ+IbaR0Bi7tHjVyIt0/lOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WMU4xMWmRM90qHZa5X1HqgQcFvWnVVWobsSMNbGLWSOp25NG5oVRcQuDQFapOVEGC BzsECCrl0XsUTUY56C/Ek9XIKbRi51PzIGVHysVcW3dkMmpvZG+n9rUS33ZvssIXgd ftNzDhREILj2Z8TKdX9ba2bhYnHhjE9zR8isqyCo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Liang He , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 081/120] of: mdio: Add of_node_put() when breaking out of for_each_xx Date: Mon, 26 Sep 2022 12:11:54 +0200 Message-Id: <20220926100754.000489671@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liang He [ Upstream commit 1c48709e6d9d353acaaac1d8e33474756b121d78 ] In of_mdiobus_register(), we should call of_node_put() for 'child' escaped out of for_each_available_child_of_node(). Fixes: 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral") Co-developed-by: Miaoqian Lin Signed-off-by: Miaoqian Lin Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220913125659.3331969-1-windhl@126.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/of/of_mdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 26ddb4cc675a..7a3de2b5de0c 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -281,6 +281,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) return 0; unregister: + of_node_put(child); mdiobus_unregister(mdio); return rc; } -- 2.35.1