Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2292534pxp; Mon, 21 Mar 2022 16:05:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiUR02F9CpJ4IHeyM1MPdemkuHpub5sxS/B2VCe/kkSPv1YqeA0SatSYK+dWIjKn9L96Bq X-Received: by 2002:a63:1913:0:b0:381:ede3:9adc with SMTP id z19-20020a631913000000b00381ede39adcmr19819399pgl.141.1647903925076; Mon, 21 Mar 2022 16:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647903925; cv=none; d=google.com; s=arc-20160816; b=TusQN04ySSE1LFHuQOnvRqnAmhS0qAWH+RC7ZCpp6nUK0J4MUEU/j4IfZYYM/UI2Wq YJ6O2Pg0xj19+5sbue8wdK16onPioWXTGQ9pmb13dWTiL2zMExxS3ZmVu9Zhz9qYLa5S f3WDzpK7oeyV4oli97RzzI1nlQq4sNE9O66+RtJDXsYC29vAgIlcc6JmB+WqcXYAuPko p1ORRbAVn1Of5OUBzW1dpOetZQbRTlctWlCL4T9fzwc6Zxiwo451zs5NRU/9I/GVhKog aZWRJf8TDAvhiIOpt3//dgeMuXnfc4riKtxOyHpU3Fsea0sHchiZOcB0ZOuAKDksdWp0 LtlQ== 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=3kKilB0oAECMQ0fDXVI8Hy2Tm6xt/OP+mJtMmUw03cI=; b=g9Eb6J44Lr7JGfGclUweNFn89/ZYFn01KsJ0sj88e4kJx1z54u+yONiaF6n+GWrmcZ 2+V2UrZGESNd9woNkLy1Q3JdlSy0IvnE5pwgytTFFE+PGbekfYIYB3tmcECWdGkvI/21 ttANxmlsj+GUz/TACMs4wSOE9aEl2/NJ73YM6gz+LBjO85+fpk1k53UCCC4HZyW1/Tqq usNwGq+5oXN4tgbs7/7ocgQZQ/Evqiz2O5xDrgJENGvCorvKvHozzcIqi2F/Yhpgz79C 4cZ6B0dwiRRP1Y9kF4E9mUQHOqqhmQ+yKKJPHoLRHxjIpj968+kAFguCFiojyisF91H5 1pWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MeHRHccW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 5-20020a630405000000b003816043f08bsi2929211pge.640.2022.03.21.16.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:05:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MeHRHccW; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C411A415CEF; Mon, 21 Mar 2022 15:04:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351439AbiCUOLE (ORCPT + 99 others); Mon, 21 Mar 2022 10:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349130AbiCUODV (ORCPT ); Mon, 21 Mar 2022 10:03:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7DC141F90; Mon, 21 Mar 2022 07:00: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 C1A8B611D5; Mon, 21 Mar 2022 14:00:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D18C7C340E8; Mon, 21 Mar 2022 14:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647871226; bh=HJC+tV5WL/Jo6vBUVK6nxlM2E40ekaBNFwJNEPvpV3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MeHRHccWlt4xYJUXaWYpKJlhqByJHyaJWR4Rvk9lYcW7ZF9TK3WPLsBCwNJmRtwYp eU7st2/kaxjfl8j+gYeYyixshcDniPgUMzVov3mq+CEXS4933VXyBcA2cLwTiLx1hB 27nv3fVQxO0ci3qr65Preuq5d4CTpn8UNNTJGhco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 19/32] net: dsa: Add missing of_node_put() in dsa_port_parse_of Date: Mon, 21 Mar 2022 14:52:55 +0100 Message-Id: <20220321133221.119797230@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133220.559554263@linuxfoundation.org> References: <20220321133220.559554263@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 cb0b430b4e3acc88c85e0ad2e25f2a25a5765262 ] The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220316082602.10785-1-linmq006@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/dsa/dsa2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index e9911b18bdbf..e7fa8ce41a4c 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -1341,6 +1341,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn) const char *user_protocol; master = of_find_net_device_by_node(ethernet); + of_node_put(ethernet); if (!master) return -EPROBE_DEFER; -- 2.34.1