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 AE08AC61DA4 for ; Fri, 3 Feb 2023 09:41:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232936AbjBCJla (ORCPT ); Fri, 3 Feb 2023 04:41:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233106AbjBCJlI (ORCPT ); Fri, 3 Feb 2023 04:41:08 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB712BED3 for ; Fri, 3 Feb 2023 01:40:52 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id CB6782101F; Fri, 3 Feb 2023 09:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1675417250; 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=emxkErsltdCzCNUd9KJ+7BQ1tmdnuyElCYTzzwlW30M=; b=MZop+qBCoWPn9+83Z2htCExJ9Sc3dS5iaeYDocrP7oH42C7ZlmcbVheZusDnReCnTJz0Ot PxgzCji53XLCVZ795GzTv8CCul5rkVkDRT8LdZtYVjxCkBEFhq1ZplUi1WjJNyKYfxJV3T ZnHe2JC28kD6pkZj7EekGjVG8tr05CQ= Received: from suse.cz (unknown [10.100.208.146]) (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 5AFCE2C141; Fri, 3 Feb 2023 09:40:50 +0000 (UTC) Date: Fri, 3 Feb 2023 10:40:49 +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 Reviewed-by: Petr Mladek Best Regards, Petr