From patchwork Thu Jul 1 01:50:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12353187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F9F0C11F68 for ; Thu, 1 Jul 2021 01:50:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 01C1261468 for ; Thu, 1 Jul 2021 01:50:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01C1261468 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7C8368D0214; Wed, 30 Jun 2021 21:50:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7773D8D0202; Wed, 30 Jun 2021 21:50:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CB268D0214; Wed, 30 Jun 2021 21:50:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 3797F8D0202 for ; Wed, 30 Jun 2021 21:50:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0BD58180883DD for ; Thu, 1 Jul 2021 01:50:38 +0000 (UTC) X-FDA: 78312339756.23.BA1715E Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf29.hostedemail.com (Postfix) with ESMTP id C8F499000326 for ; Thu, 1 Jul 2021 01:50:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E346D61241; Thu, 1 Jul 2021 01:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1625104237; bh=jjK0vP4z5S8Qw8Nrw75eoUT+YTFBaPnX8il2WKqqGh4=; h=Date:From:To:Subject:In-Reply-To:From; b=iVzsDawq87TsysRHGA+lzCNFxIKtz0ZJWKzN4ig0vR1G44TlgCRAui2JD0ULWjR4f UiGrz6Hh4+CSmTYYug9M9bi+SC8i5qCM2evaWnYVaCkLnfBAGGklS7euKCeY//mPWL Ob4spCDwaW5GgMu5r81yXWlusKzL9pU5YBdtGtV0= Date: Wed, 30 Jun 2021 18:50:36 -0700 From: Andrew Morton To: akpm@linux-foundation.org, hdanton@sina.com, linmiaohe@huawei.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, vitaly.wool@konsulko.com Subject: [patch 064/192] mm/z3fold: fix potential memory leak in z3fold_destroy_pool() Message-ID: <20210701015036.QdGlpLe6T%akpm@linux-foundation.org> In-Reply-To: <20210630184624.9ca1937310b0dd5ce66b30e7@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=iVzsDawq; dmarc=none; spf=pass (imf29.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: co4wrh5hc39cfr5tpszjh6g3auzf798q X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C8F499000326 X-HE-Tag: 1625104237-197771 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Miaohe Lin Subject: mm/z3fold: fix potential memory leak in z3fold_destroy_pool() There is a memory leak in z3fold_destroy_pool() as it forgets to free_percpu pool->unbuddied. Call free_percpu for pool->unbuddied to fix this issue. Link: https://lkml.kernel.org/r/20210619093151.1492174-6-linmiaohe@huawei.com Fixes: d30561c56f41 ("z3fold: use per-cpu unbuddied lists") Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Cc: Hillf Danton Signed-off-by: Andrew Morton --- mm/z3fold.c | 1 + 1 file changed, 1 insertion(+) --- a/mm/z3fold.c~mm-z3fold-fix-potential-memory-leak-in-z3fold_destroy_pool +++ a/mm/z3fold.c @@ -1046,6 +1046,7 @@ static void z3fold_destroy_pool(struct z destroy_workqueue(pool->compact_wq); destroy_workqueue(pool->release_wq); z3fold_unregister_migration(pool); + free_percpu(pool->unbuddied); kfree(pool); }