Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2304441pxp; Mon, 21 Mar 2022 16:24:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6nrG4oEA10r1Y+zwdRu2iQ7nSRw3RpGKxUwjpx+zZr+Y3AaetkM/llKX2/kL+xZ5ARtJ9 X-Received: by 2002:a05:6a00:c93:b0:4f7:ad05:2f36 with SMTP id a19-20020a056a000c9300b004f7ad052f36mr25893784pfv.41.1647905070396; Mon, 21 Mar 2022 16:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905070; cv=none; d=google.com; s=arc-20160816; b=VLpc456Fmrb3SuFM5WU5VP8Bur5UMEw1yHsPyupjyikTmTX+SUSIwAT6A03Y9d+6ZX C9dufy2MM6coHUsWg+Z4EUrnMgD1qoC7bAFhXV312p+/Db3GcIAAPmkpiWx0W6vfdji0 NRH7/ihRZJAndBgTqbi+hXbQDrPFFjeSVfOHh6OPCxLIoUM8CodFUttdVHT4bmYdj8EM I9Ev6qJGI54gRZiAfIKMnicw5TRqp14ziViLg415R2R+mSLhfOECrrE42tTaXqWg1P0Q eaLcL/gxfQi2AR+32f9xwLlgn8mVQN1kM/eBcYPFCaDOPJJSsVNK7frRF66J5/gN9TvO tRMw== 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=j5dMWktPXSYqjL6tuvpuD1V2eoW9dQw82XpHebhAcJ8=; b=Hdfi7RT0ktuaXi5UkrkXxfhqRFpJpBPBwwOY9RrIydscHLdJHCok8CWPVDdQ6aZ/+T /6WbxgoD3AvcvzhUEh2hCT9sINNXbKbuGaVmZvxfckozuVVAFUGkjMvDUss5p6A4Izz1 a+g3DMzudCqqKYE7sQIr2CiyPDTv3Xqoa4P6hz/1kx0+cl0BlYGfYy/l2MKYqnlLQV+R Zy7v9xR1b5AC6wQnrgweeANoICgHzLBYettJ+xBK/JMUvQEVkQeQ304mnk+cUSmNzYI6 YdohqvScwtV9kCRD3PKRDlL9tozSA1Q3ffhtxQS38zBbWSXe62dS8tcsDcmvW4iy2oNe 5HOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MpEpNejE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k8-20020a170902ce0800b00153b2d165c4si12638874plg.460.2022.03.21.16.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:24:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MpEpNejE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 4D3184503BF; Mon, 21 Mar 2022 15:15:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349008AbiCUOGu (ORCPT + 99 others); Mon, 21 Mar 2022 10:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349009AbiCUN6r (ORCPT ); Mon, 21 Mar 2022 09:58:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3DA2173F72; Mon, 21 Mar 2022 06:57:04 -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 358A06125C; Mon, 21 Mar 2022 13:57:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D906C340E8; Mon, 21 Mar 2022 13:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647871023; bh=4eqieXDYNFS9cksTph0yiFqzYytb0whZ/l9AHeJgR9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpEpNejE/dPBPxMABLXK+LBFoP6iFQjQvjM/TPao+YMzigy+KxfZP8tBEWLetRUcF o9Ob3jXm+eFhnEg2aKXBqw9+c9vag5bX48n5Uqpkx69K1kRz96cT0lw6dyoE6AdZdt EIuNr7wUkNDJpFxbTAe5G3YnDEllzm7coGaEnDt4= 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 4.19 53/57] net: dsa: Add missing of_node_put() in dsa_port_parse_of Date: Mon, 21 Mar 2022 14:52:34 +0100 Message-Id: <20220321133223.520348360@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133221.984120927@linuxfoundation.org> References: <20220321133221.984120927@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 7c10bc4dacd3..05aadb25e294 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -596,6 +596,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn) struct net_device *master; master = of_find_net_device_by_node(ethernet); + of_node_put(ethernet); if (!master) return -EPROBE_DEFER; -- 2.34.1