From patchwork Thu Feb 9 19:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 55066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp526726wrn; Thu, 9 Feb 2023 11:23:32 -0800 (PST) X-Google-Smtp-Source: AK7set/zN02F/JZMdV91CtovvkBM8p/epQffANCqG2CM0/BoMQEv0W5FoT1XSIxYqX4CA8zyBNLd X-Received: by 2002:a17:906:fad2:b0:886:221b:44de with SMTP id lu18-20020a170906fad200b00886221b44demr13743103ejb.0.1675970612754; Thu, 09 Feb 2023 11:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675970612; cv=none; d=google.com; s=arc-20160816; b=JLzV+OE11e7lQosf/Jz/CFNrbu6rNra9JsjRRwTJByzSCC9TUY2fb5KBHozp6CL00s BWCUdcUk53oLREU0l1HT1NojmL6OCvZKJqtuEfx6oV61TNM/bjXNIG8DN84dtxUr0m8y a15fNEQ3PCvVw0jFxOVBwwbqwNHTLgTm1vRvoa/G4rqmUnKdEFWxwmhW3IoEj9yp/FOy RDi+R52dMENRY+8d2AX+UE81PFxbl7B4ub5W7pbjdrn724fBa4jplqTe9VEGXkLTYtt8 B8vSbq0U3YggRzp9vgvj+HyN/h4/h+vskCA2Oplc0NOzN4uMx/7e8xnL3/FWdrbH0gml QSoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=EMfFhGLF4YWoUbRpNumcg9SymF+uDoK+UCqfijLwxQs=; b=LQ1MMpntcJLGG7GUOZkqI1uF2CUDPDXNfatz+dAeTZhfCAQjHsApWUpp2/Ze6xUnHr Rj2+n5Yc9aki2cTPL5LFMq1iMGYzyC9D2lKalNO+Ex6+NK1MDDpgt6Bsoj4TCrxHfLl1 6hqW6ZF201GDtENxfyzuO2/lBA54OhAirtnVihHfC92HEHM6bq098TTWMmEHmq26C/xx 6XTyYjVZ7+c1l8+y0uGZihG3hCF+sm15WzO27GvKJAagL6hGTDmCgybRINogyh0fHR5+ IdjSUpB32EHdK9rZuM5i40XlksInYflvkL/8x+6OeZ4jk80CY83jsbHPMBSmov9steDu L0GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rdH8grVm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a1709063f4700b0087ee8f41dd1si3400780ejj.378.2023.02.09.11.23.09; Thu, 09 Feb 2023 11:23:32 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=rdH8grVm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjBITQu (ORCPT + 99 others); Thu, 9 Feb 2023 14:16:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbjBITQt (ORCPT ); Thu, 9 Feb 2023 14:16:49 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6478E5DC31; Thu, 9 Feb 2023 11:16:45 -0800 (PST) Date: Thu, 09 Feb 2023 19:16:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675970203; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EMfFhGLF4YWoUbRpNumcg9SymF+uDoK+UCqfijLwxQs=; b=rdH8grVmRxQqy5WFKFjklX0VoNI2L8ylZqKwweZVBEcxF4wXWsBmMQV+3t/GAV52MS1Ba/ 444WodgRlE3ll6cRQFHvRb+2PY62wCukz12Xveg1fwlbp49LF0ZUA4JNHhwyjjc8cxt/yJ pZWoCQyo44ocSfGn6E99n/NDJWVPQmbPQZ2txwgoCeGW1FoN0jWNW3QzfsMJLX/sx8DSpl syRkp8Bg2mzRA0zadRUgkvKs+vcf5/QPCdfLQgDWpSZzGnVgewWaauC+GcGZtEtXZQJWEX 5K+o8m2GmTYPQAcdfI2uaesWP2rAmRD7EmgcMqtHVbDRv8tyxSi4RSBksKzO9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675970203; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EMfFhGLF4YWoUbRpNumcg9SymF+uDoK+UCqfijLwxQs=; b=EdTO/Z+U2ylnrwa1CzUuKYUqnisZ5unDYdsqmYdzVr9VYNWYZZXr+sq01h5+Ki/qzo9hV4 o9wOt+da9n3sQ/Dg== From: "tip-bot2 for Greg Kroah-Hartman" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] time/debug: Fix memory leak with using debugfs_lookup() Cc: "Greg Kroah-Hartman" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230202151214.2306822-1-gregkh@linuxfoundation.org> References: <20230202151214.2306822-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Message-ID: <167597020257.4906.14385983132728643575.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757382561540551574?= X-GMAIL-MSGID: =?utf-8?q?1757382561540551574?= The following commit has been merged into the timers/core branch of tip: Commit-ID: 5b268d8abaec6cbd4bd70d062e769098d96670aa Gitweb: https://git.kernel.org/tip/5b268d8abaec6cbd4bd70d062e769098d96670aa Author: Greg Kroah-Hartman AuthorDate: Thu, 02 Feb 2023 16:12:14 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 09 Feb 2023 20:12:27 +01:00 time/debug: Fix memory leak with using debugfs_lookup() When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230202151214.2306822-1-gregkh@linuxfoundation.org --- kernel/time/test_udelay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/test_udelay.c b/kernel/time/test_udelay.c index 13b11eb..20d5df6 100644 --- a/kernel/time/test_udelay.c +++ b/kernel/time/test_udelay.c @@ -149,7 +149,7 @@ module_init(udelay_test_init); static void __exit udelay_test_exit(void) { mutex_lock(&udelay_test_lock); - debugfs_remove(debugfs_lookup(DEBUGFS_FILENAME, NULL)); + debugfs_lookup_and_remove(DEBUGFS_FILENAME, NULL); mutex_unlock(&udelay_test_lock); }