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 1DCD2C05027 for ; Fri, 3 Feb 2023 17:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232601AbjBCRsn (ORCPT ); Fri, 3 Feb 2023 12:48:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjBCRsj (ORCPT ); Fri, 3 Feb 2023 12:48:39 -0500 Received: from out-13.mta0.migadu.com (out-13.mta0.migadu.com [IPv6:2001:41d0:1004:224b::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 605962069C for ; Fri, 3 Feb 2023 09:48:20 -0800 (PST) Date: Fri, 3 Feb 2023 09:47:34 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1675446465; h=from:from:reply-to:subject:subject: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=LmsXysxMfYtegr5dVQ+/SDGY+y8MjYLbIXG3YSolM3M=; b=O+uDUWm4eyxjCb1gbU5IMQ9MgqQPqYGTl1wGbSz3HvtnLCmrFlScdYFAl261orz5VDHMsW 2R3lojbaXHuTFKzwuRIxaKu8FU5Oh4xtX0tdLPnw8OG7DDmnDOX+PccpYgqVZxQ0S2+gGi XkklnbdOgQuWaUEYXAXObCVWLzX5kcc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Greg Kroah-Hartman Cc: linux-mm@kvack.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slub: fix memory leak with using debugfs_lookup() Message-ID: References: <20230202142022.2300096-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230202142022.2300096-1-gregkh@linuxfoundation.org> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 02, 2023 at 03:20:22PM +0100, 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: Christoph Lameter > Cc: Pekka Enberg > Cc: David Rientjes > Cc: Joonsoo Kim > Cc: Andrew Morton > Cc: Vlastimil Babka > Cc: Roman Gushchin > Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman Good catch! Acked-by: Roman Gushchin Thanks!