Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2940240rdh; Mon, 27 Nov 2023 02:59:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6T5ZWJe/hT7RuzjMi4UAplhqaqoVtgTvdF7TxDn3aMlIYWgmXXGhGPLyn5I7XSXyYPIyB X-Received: by 2002:a05:6830:4128:b0:6bd:152f:990e with SMTP id w40-20020a056830412800b006bd152f990emr12345883ott.5.1701082763951; Mon, 27 Nov 2023 02:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701082763; cv=none; d=google.com; s=arc-20160816; b=ZfKfESh6pXfTdF5r9SOEPIE7xX+a0ZAbAy5o/FVF0R/eG2diZMTKKE7COBjuXxzma/ ZrHzJIbElT5Un6CYIxtW36pofs/P6/pvhjf3k4AltxYdsd/sh/C4Sph7v5pDMRwYuEEX sTsN6DgGbqv3+MrWs8eX2ZJkqjK137Wfng99hFb1HkuQdvy2E3TSkThBCdAu8JEGpnyN 2Z8I2rzy6+IZNwPC+7SWd56VDGLsCV6mtX6h5PmaKzPoQO8lEM5s9bC3oX6gpZnnBfva 3gCw/+R2O9hon+MzEWi8q7Yp+0bamTw0pk+rs7bnULcErie4OaYVRuvXlYizizv6W0KM lNnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5c77jX604KDqrJIwqf8oHJEZZCmkNXyEAg0Pg2uq5RY=; fh=BfiVUdyqeG2wK8rdoyCB08bdkpA7YPaPHBOINgu/zug=; b=eyxE87Sx5CufuEC3c9W8FP7sFZQPJonqvtvpgeHTrcciNE5sfJKzEoSsKmV5GDmT5I ejMgzZNLLeM15lha0hWeadNxspdLB1n97/z7mY6UpwIQHDKik32aNY26/CwNcleogp+d xhD8EfyAoEmHBB44ucEEBd1p230U46Ebhx5tNc5xpflAQl7KQwzmXW95TlQAZtRN8dwU Qb+tc00Gz86ynu0gW1yx8HOVuoyfIF2g/iSxFkbIuhh1wJ939jgHt3u/OqWvkifHiBvy IWCcMDUYEHzai8d0h/U0VfCgtn1AlJQ7ULuIODRtJ1XlIUIkjoZ5g2djLKl/DU3QLu94 9DUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=igN3vDDx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s3-20020a656443000000b0057776b67494si9548275pgv.887.2023.11.27.02.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:59:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=igN3vDDx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7F98C806A40C; Mon, 27 Nov 2023 02:59:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232519AbjK0K7N (ORCPT + 99 others); Mon, 27 Nov 2023 05:59:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbjK0K7L (ORCPT ); Mon, 27 Nov 2023 05:59:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34827111; Mon, 27 Nov 2023 02:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701082758; x=1732618758; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=80De8qycEWjfHCnBb/Miiu/rgN7Tlt+pCnZshwbCFUQ=; b=igN3vDDx48vwnEeqbHZlT5GnpgDKPjctTxmaI1UOeVlMnJ75zp+PDZVW 3CZjvSQA2NzZIYTF8axokEOlSc2WmESR0TvaZrLs4/2dSy3d0Zvxkst8C DO0ChWf8jBYIoiMUUPAIWdmJaNlwgHtJYx5XdthKHRakXTT/dOKqp1K/H 0TNhmXbodwb1kwlQhsWafDyqlgXCKv3hMRYWEyFTUdOK5c6tx8fMamMMX cCkc1CdGSpnGL1DBibbvme+MTsfD0SU+46MGiHXoeu0LX4UlH0ug2WaiW 4TwFZV9rT5Rs1TJiYEdC1zTfZ8PLYcic9dsFRJIRAijqTlzoic1ujjLiP g==; X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="5869179" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="5869179" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 02:59:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="859010494" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="859010494" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 27 Nov 2023 02:59:15 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 834A82A2; Mon, 27 Nov 2023 12:59:14 +0200 (EET) Date: Mon, 27 Nov 2023 12:59:14 +0200 From: Mika Westerberg To: Yaxiong Tian Cc: michael.jamet@intel.com, gregkh@linuxfoundation.org, andreas.noever@gmail.com, YehezkelShB@gmail.com, tianyaxiong@kylinos.cn, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] thunderbolt:debugfs:Fix memory leak with using debugfs_lookup() Message-ID: <20231127105914.GL1074920@black.fi.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 02:59:22 -0800 (PST) On Wed, Nov 22, 2023 at 04:02:43PM +0800, Yaxiong Tian wrote: > From: Yaxiong Tian > > As Greg said,When calling debugfs_lookup() the result must have dput() > called on it,otherwise the memory will leak over time. > So just call debugfs_lookup_and_remove() instead. > > Fixes: d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining") > Signed-off-by: Yaxiong Tian Slightly modified the commit log and applied to thunderbolt.git/fixes, thanks!