Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp634262rwb; Fri, 2 Sep 2022 22:53:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5w8IBzJsRQmpwerVtYu0buTxKTgr6dLLPdDM3HqjpmZBvUYf75MNuZHU+o2/KAsU/TWx6d X-Received: by 2002:a05:6402:4150:b0:44a:ec16:def4 with SMTP id x16-20020a056402415000b0044aec16def4mr9394288eda.21.1662184427185; Fri, 02 Sep 2022 22:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662184427; cv=none; d=google.com; s=arc-20160816; b=VDTSJtcISI81s5ORxMUTp04EiPqL+6H06VnxKSax8WdJOBWtqJGtPkjjCaeTw4Acnu uJ6RKJdEpPxeiezFyDLEN9BQg4pgnqVFXBqi13UdvH366zGuU0v5fMxA7yjjOwddmNVh WfOIUsel2g4n+9Ap2n59u7nFafW68+7aSb+sZqBQR4JYeN1xIUxojGw6amodBd0493LQ 3ck4ggZvZFS3TH7fgDXGeKAOFKTVKVHdg3p3l3UldPr6XqOm+F7J/wBjj2C1cyGcHPju G9HGicEJXG03vjxuQujPIU3eZdMku7RxGzDfUetrYSEsRm52CoEtBtQQhDpVRYEB6VTw xRfA== 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=PI86l9Q2LcD5Xz1iF3nH0NZmKgiB9W2SIqQTr4zJPak=; b=emlANRx2s2FAECYi7M2G8FsH444CidC4a+bnNZWfCS4dRH3/NnrAE3fjRCG2ae/qCK slQFgubxj5iCTDgMPy4ErF76Xk/O64/WG/HT7cNGyBa75sEAFtRqtNUo43ipDSOGocik 69uNsRXRgh6oqiQdwgEYEJrjXYMjSBcxf38IcmKvm1tlen1gBO04OJBZ6f7UiSUxXcbW iR/9c4asAQhNtyrZT0kJG8OAVMm57/8Sd3iGBhb3eE73Yb9RFo7tMTXOrsdBhEZQDxL0 Xg7MkaPOYXrY7OjgbNyiWo7kZI5sIQMuFHUE41Ufah+riM91JvaKCWjT+qyMC3SspXob gJTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hv3UQax3; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k25-20020a17090632d900b0073d5f9f2dd2si3046637ejk.455.2022.09.02.22.53.21; Fri, 02 Sep 2022 22:53:47 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=Hv3UQax3; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232130AbiICFgY (ORCPT + 99 others); Sat, 3 Sep 2022 01:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbiICFgW (ORCPT ); Sat, 3 Sep 2022 01:36:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9A02C64F; Fri, 2 Sep 2022 22:36:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A6429609D0; Sat, 3 Sep 2022 05:36:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70DB3C433C1; Sat, 3 Sep 2022 05:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662183381; bh=OpKJfWdrDc3n3wA6yyELGco8XbWwsYE05NA7T35/G2M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hv3UQax3zC9KwiMM1HJaOv5cCenbfX3sbxN7smMl4G/+VABgRVil24EXJn7Ho32Cb +ScKqzdQxPZGXOux5Guv75MhbvbZNmu+ISgv7Ob8aQEX2OiTUghk0btQpKrPiysz81 KJaKP+lACKs8DYJdw2+aSzSLI4laZi++O54F71sw= Date: Sat, 3 Sep 2022 07:36:38 +0200 From: Greg KH To: SeongJae Park Cc: akpm@linux-foundation.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mm/damon/dbgfs: fix memory leak when using Message-ID: References: <20220902191149.112434-1-sj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220902191149.112434-1-sj@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 On Fri, Sep 02, 2022 at 07:11:49PM +0000, SeongJae Park wrote: > From: Greg Kroah-Hartman > > debugfs_lookup() > Date: Fri, 2 Sep 2022 14:56:31 +0200 [thread overview] > Message-ID: <20220902125631.128329-1-gregkh@linuxfoundation.org> (raw) > > When calling debugfs_lookup() the result must have dput() called on it, > otherwise the memory will leak over time. Fix this up by properly > calling dput(). > > Fixes: 75c1c2b53c78b ("mm/damon/dbgfs: support multiple contexts") > Cc: # 5.15.x > Cc: SeongJae Park > Cc: Andrew Morton > Cc: damon@lists.linux.dev > Cc: linux-mm@kvack.org > Signed-off-by: Greg Kroah-Hartman > Signed-off-by: Andrew Morton > Signed-off-by: SeongJae Park > --- > Changes from v1 > (https://lore.kernel.org/damon/20220902125631.128329-1-gregkh@linuxfoundation.org/) > - Call dput() for failure-return case (Andrew Morton) Thanks for fixing this up, I missed the other return error cases in my rush to audit the whole tree at once. This version looks great, and I see Andrew has taken it now into his tree, thanks! greg k-h