Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6289144iob; Tue, 10 May 2022 15:01:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzltkwBPe0SpTqpnnNKxtRfCII5JPR91/DJ4LtkqHas+DkNsr4UZpm2NU4DMVTaYS3Gq62X X-Received: by 2002:a17:90b:3a83:b0:1dc:b7d4:8395 with SMTP id om3-20020a17090b3a8300b001dcb7d48395mr1906545pjb.173.1652220099872; Tue, 10 May 2022 15:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652220099; cv=none; d=google.com; s=arc-20160816; b=Pb5VlIbG3uDPyRDJkyQ9/UZOTZwowjXj8RkBobxB+iv+OIl3InO+DtXwAoNNaCGmXI VpeEl/rsnJv53ut41yalphC12A+HlKqxCypiXxDi2QB3mcAR3IhwR25WR2GH9zIaeLp6 ZNbZhqQX6SStxXG7bIy2k3txMC2D5H7ndkedRCXuaMKjTwBmwPda3HF5DGNUJt+ZtuWd kGIrzqzFKINItqemEmBOc08/qOMLmPunTpbYcJJJn29pGTAj6fpqwD9pwLromdVvugwu csBJRS47Oecz+TJJCIT5t66PSZU5mPNtbIMYAKiDP8+mMNthQScN+3itvyxLZcHR7I4f CMhg== 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=r5aQpjLdMiEZXJd44fN5PWK5UMrcSwMxth9c+OkkjAE=; b=HQy3rSFlOmutMCrpTOOMMAwR9A+LGv7xULjzkUxLv9nkR8dg55Uj9YmPolGF4XKSqu gYIOkp5AtjmXPUoo/IqrTV2bUY72qCyWlKt4sGreeH/VLjBoT5ouXZJvDi2V28+iNvCv sj3GegFkYMuaNntjeqWEMtMlFNF8T6quCxEzRCk+oAsCvoXaD5Jh45d0bdpx9Y9ci//D 5wlMwpL2Uz9xdJY0qKP0/DwS64hl+gHsYX5i01AufDlODpD9Xbr7c84TNyndV1VnPqXF CtdiAK0he1HUE4Fq+YWclVcfcZpm7zRCsfwW3hfTnr/zVTPbliEhdBdwgMUqfvsl2fH8 z3jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f0Gu6chC; 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 ic6-20020a17090b414600b001dc72c6382csi3783345pjb.31.2022.05.10.15.01.24; Tue, 10 May 2022 15:01:39 -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=f0Gu6chC; 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 S244885AbiEJN4n (ORCPT + 99 others); Tue, 10 May 2022 09:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245010AbiEJNiW (ORCPT ); Tue, 10 May 2022 09:38:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42AA98F44; Tue, 10 May 2022 06:26:52 -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 22C1C61820; Tue, 10 May 2022 13:26:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F279C385A6; Tue, 10 May 2022 13:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189211; bh=f6/fAM20VGRb4U0ansRcxlQekxwjGuCT/6+lSGaEZz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0Gu6chCp4sTlO6Wq/tA9E1oXn8KAa/Q0Uk2/3EVW7LMvZ9DRzKaXmI1erysbuUZe wDWtxyTqYvOhMmlJaRVjdg6hGeMIJ2VxhHtUN4ao15G2XXbGo3Od4mNjOo1VOQsyQh gDnRuBsXW08h2YJh88600mjGI3jNxcXtniGKd8BE= 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.10 48/70] net: cpsw: add missing of_node_put() in cpsw_probe_dt() Date: Tue, 10 May 2022 15:08:07 +0200 Message-Id: <20220510130734.266836554@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130732.861729621@linuxfoundation.org> References: <20220510130732.861729621@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 @@ -1255,8 +1255,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... */ @@ -1353,6 +1355,7 @@ static int cpsw_probe_dt(struct cpsw_com err_node_put: of_node_put(port_np); + of_node_put(tmp_node); return ret; }