Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp936929pxp; Wed, 16 Mar 2022 21:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpXimu2LeFIe/3YQXBj7u3dtr/IRuVO2wtsEAsIYglFSaNULemD9hnXcmxITJJlwF2acAA X-Received: by 2002:a17:902:a98b:b0:14f:ae28:c660 with SMTP id bh11-20020a170902a98b00b0014fae28c660mr3380819plb.94.1647492976761; Wed, 16 Mar 2022 21:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647492976; cv=none; d=google.com; s=arc-20160816; b=v9cAiSabGWpuF+osZ2OivWGYvkvQ1/UWNF3QtquOqvKDMyT7LZPCsIQb9wVZvpomy1 gLtGoGH+cBMNQv3A+bdbyaKZY1gSG7RzojgYF4jmV9im0XqvoBMjfofXD5cmYCDSRHWV k+fCd0j2/7mkCYcTTVlmlimXkdX6eZ3zUwcbpAnl7cwN+laj/rGUQ8oPaAmX9urOxFvt Hzb9e5iuMQK/9J1Umfie5mNT02Qu/vaUTUelj0Bg9MWwrfsbqYGURJAw2J3z3E6e8shX IpTREow00Mib3xGR4qk6XWQ/bMlGxfFg1M8tVJZ88l1JUvhesPfJKETM3G7zuDIfKiwp YRYw== 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=IGxpFGlXrMoeZVmKbZ2jrVleHboP5pIChEfYP/aJQoY=; b=oJ2ik3J2iaVlaFfQWvXnhljQod+6O31QvPLCx8vaj18914PeNIlYwLLnMPbbF/3tQn THO0J17ML8rprqAARdnNjLmO7qXtFOqVIfg5crtbMCCkCLW5ifSAnCVKNVhWzHZLJJif HaXbLWu3sss9+xqcwxZ4nqL/h1CZddGNOfZEytBMF9mEcej89k/1nJ23h2gzSa9Se+ne eTjgmO4hlX3SfqjNGqJni/J9dW3JatEno2+KH/3kQq4YksmOseWZJQecJK6BZ+PSAw1i R0S+gnhAm39tL9YJfwYoTSNCVPzFjoZNjNzZH/w80Cu4OXXy2EUNdMOl8dRDO3fdqfp7 3QLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z43ssyyJ; 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 k31-20020a634b5f000000b003816043ef45si1053813pgl.314.2022.03.16.21.56.03; Wed, 16 Mar 2022 21:56:16 -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=z43ssyyJ; 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 S243689AbiCNMbJ (ORCPT + 99 others); Mon, 14 Mar 2022 08:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242914AbiCNMTx (ORCPT ); Mon, 14 Mar 2022 08:19:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7425517C5; Mon, 14 Mar 2022 05:14:59 -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 1521160929; Mon, 14 Mar 2022 12:14:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D8C1C340E9; Mon, 14 Mar 2022 12:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260094; bh=eIr6ZTJRrWrCrkryosiWHob+tuFrPxc3tw/2su8Mjnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z43ssyyJfdcFbb4H7w2Kb4R7+5fUJdzVu+76+tBepq1asOuOl7CE/zODM/Q2zSAr7 cPrPPrqBehCLk5Wy9yNkLmB+b5DxTmhZQkP5FZ8+zInylr5Ohn0FU/ZQvEHcOU62YA +A/hTsIS2BgYm+5UKZGyGrftJBMc+HC43kl2TZWE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Jesse Brandeburg , Claudiu Manoil , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.16 054/121] gianfar: ethtool: Fix refcount leak in gfar_get_ts_info Date: Mon, 14 Mar 2022 12:53:57 +0100 Message-Id: <20220314112745.634906408@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@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.6 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 2ac5b58e645c66932438bb021cb5b52097ce70b0 ] The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: 7349a74ea75c ("net: ethernet: gianfar_ethtool: get phc index through drvdata") Signed-off-by: Miaoqian Lin Reviewed-by: Jesse Brandeburg Reviewed-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220310015313.14938-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/gianfar_ethtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 7b32ed29bf4c..8c17fe5d66ed 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -1460,6 +1460,7 @@ static int gfar_get_ts_info(struct net_device *dev, ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp"); if (ptp_node) { ptp_dev = of_find_device_by_node(ptp_node); + of_node_put(ptp_node); if (ptp_dev) ptp = platform_get_drvdata(ptp_dev); } -- 2.34.1