Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB17BC61DA4 for ; Fri, 3 Feb 2023 10:16:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232768AbjBCKQn (ORCPT ); Fri, 3 Feb 2023 05:16:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232233AbjBCKQj (ORCPT ); Fri, 3 Feb 2023 05:16:39 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F14049A81D for ; Fri, 3 Feb 2023 02:16:21 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C8EDB345EF; Fri, 3 Feb 2023 10:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1675419379; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pbfxSbKQcSLeaPBMIdbUje8e/0YksJE5yGm0ZSHNIqU=; b=U9JakQDJsKwjv/X+YGCCxLOXU9kXeBBaNf0LqUzCGwZ071VQsrYyEemXsD3EYqHyN18ALd PZFpNPBHf0litMFiD732Q58rXL0n5fqRQhfG6LgRzSFSlukE5iWeJAB1pygHSYPsudM7ag z66YMtDDO7FqjCevo+n044z+gy/DJOs= Received: from suse.cz (pmladek.udp.ovpn2.prg.suse.de [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 679AD2C141; Fri, 3 Feb 2023 10:16:19 +0000 (UTC) Date: Fri, 3 Feb 2023 11:16:17 +0100 From: Petr Mladek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Chris Down , Sergey Senozhatsky , Steven Rostedt , John Ogness Subject: Re: [PATCH] kernel/printk/index.c: fix memory leak with using debugfs_lookup() Message-ID: References: <20230202151411.2308576-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230202151411.2308576-1-gregkh@linuxfoundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2023-02-02 16:14:11, Greg Kroah-Hartman wrote: > 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. > > Cc: Chris Down > Cc: Petr Mladek > Cc: Sergey Senozhatsky > Cc: Steven Rostedt > Cc: John Ogness > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman JFYI, the patch has been committed into printk/linux.git, branch for-6.3. Best Regards, Petr