Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6286589iob; Tue, 10 May 2022 14:58:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymGz5HcIQ0wGuxG1yHSgLCa7sdIWhpAyFuAYR9sULYO/gNl1aBIh7dCv/SLsOXhnpsfwRK X-Received: by 2002:a05:6a00:1146:b0:4c9:ede0:725a with SMTP id b6-20020a056a00114600b004c9ede0725amr22439612pfm.35.1652219885503; Tue, 10 May 2022 14:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652219885; cv=none; d=google.com; s=arc-20160816; b=MWX/aGIUYp8gF1Gh6HJRhzUDi7rOf2GAMVaagR3ncH4APcl0gUWf3Db1lL19tmjMFl Typsb7aC2cvP06o+tR8Kd+clB2PdAer1bJrlRQzxmd23q5OnjqUc0Vmv+n1GhRsJw17+ 8lcCQwIiyf2pjIE54Rghv/VyiT0w8qTlceqsJV6XirBAYUsKWSDDTRGSX9Z9ML0UlCbs MAj7Pye5S0CyXJsBJn7CkB949SLLT2hcP5RdO19HYz84Q+Uk9r4NhdWuIWNA8D4QtYi4 J4kGNpe5y/c2K0E074MmZD9OHWNE+Mlfg8bmZcETQaEiXK4iMClImqSYzkzsLETfxDR4 6Xhw== 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=36hSo2ozbUlA85xgthdLH32rJ2z+7DDOR/9wziHNpOM=; b=TJhhxwiFr3GJmcUxZ7cY32Fidc/7hz3UPNcya3WuO3Dw+N3ZCe+huLXDB1Bnslh09U tEinwZnf4n80aub3X4i/W8Vvwg5GYV8XuDHM6oFlV1eDLuDyyMvOr9Pc5/iGNJ7sEtat 9Ayxsk78rJLg10rPSdCTTlsOIpwxEUtygrfsh7ywreYeyLAuZwLtaz+7cUXXZgYUy/11 gi01geQpVLWjGBwv42QFRhmxbauDf1ZaktKmbyhBGaJzLaArczX8KnrupHIdjUmlbqPg AJ4iAjJTmfKWvhTwdTmrla87rCN2V20HCAwo6GguHHHWCmQ17Oz2b2MdpCwnqAWokyMu Hnsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KG/oedab"; 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 e6-20020a170902ef4600b0015e7d5502a8si156178plx.612.2022.05.10.14.57.49; Tue, 10 May 2022 14:58:05 -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="KG/oedab"; 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 S1345107AbiEJOci (ORCPT + 99 others); Tue, 10 May 2022 10:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344069AbiEJOH1 (ORCPT ); Tue, 10 May 2022 10:07:27 -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 D09037CDFA; Tue, 10 May 2022 06:41:41 -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 3C52AB81DA0; Tue, 10 May 2022 13:41:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7023C385C2; Tue, 10 May 2022 13:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652190100; bh=AAu3wZQM5TXMCSefAdcqdNYX8X6nheEiGnbu9e2bf/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KG/oedabcfRWnfeIYAwEgkjGOp/46Yzo/RXSq4DVJFewy4dt38PWttp3LZ+I1zh15 ydlU+7fK9akGRdyQb6Jel6slVJMq5jfekq9DSAy+faJmMrP9mk6Ofqa3hVMsYJm033 ddhv0XXNEOo1cg13Ozo2LUn2SHU/malR4PCG/qng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Yingliang , "David S. Miller" Subject: [PATCH 5.17 088/140] net: cpsw: add missing of_node_put() in cpsw_probe_dt() Date: Tue, 10 May 2022 15:07:58 +0200 Message-Id: <20220510130744.126648305@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130741.600270947@linuxfoundation.org> References: <20220510130741.600270947@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=-7.7 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,URIBL_BLOCKED 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: Yang Yingliang commit 95098d5ac2551769807031444e55a0da5d4f0952 upstream. 'tmp_node' need be put before returning from cpsw_probe_dt(), so add missing of_node_put() in error path. Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ti/cpsw_new.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/ti/cpsw_new.c +++ b/drivers/net/ethernet/ti/cpsw_new.c @@ -1246,8 +1246,10 @@ static int cpsw_probe_dt(struct cpsw_com data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM, sizeof(struct cpsw_slave_data), GFP_KERNEL); - if (!data->slave_data) + if (!data->slave_data) { + of_node_put(tmp_node); return -ENOMEM; + } /* Populate all the child nodes here... */ @@ -1341,6 +1343,7 @@ static int cpsw_probe_dt(struct cpsw_com err_node_put: of_node_put(port_np); + of_node_put(tmp_node); return ret; }