Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp632549iog; Mon, 13 Jun 2022 09:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTFRv54nGIZ+zhyi0zONlHkVBEwhTvURIsbbtZtglub1LtKYxSpduVJfG98jco5UEXdOz7 X-Received: by 2002:a05:6402:ea2:b0:432:dd60:8085 with SMTP id h34-20020a0564020ea200b00432dd608085mr659108eda.108.1655137919834; Mon, 13 Jun 2022 09:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655137919; cv=none; d=google.com; s=arc-20160816; b=E4trF+d4VoOUJpGJDy6lCxh+OJoAG5M+kbkOQIMHwAK/jB1knELiO8uy0mScYww02O 22Ph+xfjLjxitEAwk9F0FQi9E249yzIzTwbNBP/6/Aea1dIw1eX6t76SDkAN2WtY1SXw RRuchfoI8JIxoJIq2fyVtKHIjt0djDv+dWKxvz34oEwWicY55ofc+mANhN12LKOO1aSK wZlaHsInBxWBiZzCEDaALEFwef490p2YiSmlTKf+RoU6anM+BhOpTlzY0CIFun0It6p2 P46mzqmTdNhF+VFhoCxjTyH3ioMpmlDMsY9CP79izptwIQRoMO5HietLNooW4szbbTND b7zg== 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=JCX4BU6IAgE/0GeXzrzIjLVnSZtOiYStRRzE6qbC4cQ=; b=m4kltXgxeXGXCiaL4W2mOBj3FBDtlk9LgoFi3FGSRKyQOiJStMSiwNhF8arXgHzfuo uoBCGhPM1XPpDSPDy6nBUVbuZDqv94rvUa8wzDsWMxBUmlHPX4ktJdgUYMmCCt62NxvF 8T9D1JTi6ILXYfQbBgm7ljEk7kwpAbmRRStjYdUcfIDMAZ//S/2ftX/J2YRzEijMv8r4 8oQAamgMX7e0D1bmhx3f0BHXajfNo2AE0nL7KRgteQBGdgZjzZcdAa8birDab1MIr9E9 PiUnwzNNBJ+9z2ruWuzvYJgoWgwaTbq2uBUSyKnFIfePvZrXJ1eiiGsRLPvD3k5/o4pn /K4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bZFbIfBP; 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 ji21-20020a170907981500b00717f2a08a2csi4578232ejc.169.2022.06.13.09.31.34; Mon, 13 Jun 2022 09:31:59 -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=bZFbIfBP; 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 S1379765AbiFMNvI (ORCPT + 99 others); Mon, 13 Jun 2022 09:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379596AbiFMNoo (ORCPT ); Mon, 13 Jun 2022 09:44:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27827DC4; Mon, 13 Jun 2022 04:32:26 -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 B7DEC6124B; Mon, 13 Jun 2022 11:32:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD45BC34114; Mon, 13 Jun 2022 11:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655119945; bh=vx54AwVCPZ4+ezTG7ZF+FlU4VqwEwS32vgxQfHlSwF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZFbIfBPA3sR9N4Ago8DXExeGrTbyUYdZBWvcN3HJyuNxMA+co4zXlTsGPrlYJYZp lVwstjXflw0/vMMi6HYHUVoIXHQc2O9RgJPj6JfXjkAuxykc4msAW/1yOGyP74z6jL XwNnA+gN7e1iFnFKjHe7/EQo0XbkmPjD8q0ioCJE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Andrew Lunn , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.18 194/339] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register Date: Mon, 13 Jun 2022 12:10:19 +0200 Message-Id: <20220613094932.552731401@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094926.497929857@linuxfoundation.org> References: <20220613094926.497929857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 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 b8d91399775c55162073bb2aca061ec42e3d4bc1 ] 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: 55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file") Signed-off-by: Miaoqian Lin Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220603133238.44114-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c index 086739e4f40a..9b83d5361699 100644 --- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c +++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c @@ -234,6 +234,7 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac) np = of_get_child_by_name(core->dev.of_node, "mdio"); err = of_mdiobus_register(mii_bus, np); + of_node_put(np); if (err) { dev_err(&core->dev, "Registration of mii bus failed\n"); goto err_free_bus; -- 2.35.1