From patchwork Fri Sep 27 03:01:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhangjiao2 X-Patchwork-Id: 13813822 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C7D8CEBF69 for ; Fri, 27 Sep 2024 03:01:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9993B6B00AB; Thu, 26 Sep 2024 23:01:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 948AE6B00AC; Thu, 26 Sep 2024 23:01:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8376B6B00AD; Thu, 26 Sep 2024 23:01:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 674966B00AB for ; Thu, 26 Sep 2024 23:01:23 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DEE9D16091C for ; Fri, 27 Sep 2024 03:01:22 +0000 (UTC) X-FDA: 82609017204.25.F1744BA Received: from cmccmta2.chinamobile.com (cmccmta8.chinamobile.com [111.22.67.151]) by imf23.hostedemail.com (Postfix) with ESMTP id BDBE914000F for ; Fri, 27 Sep 2024 03:01:19 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of zhangjiao2@cmss.chinamobile.com designates 111.22.67.151 as permitted sender) smtp.mailfrom=zhangjiao2@cmss.chinamobile.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727405991; a=rsa-sha256; cv=none; b=nUrtCbSKKoTg4GCyN8ucLFZyGG7y2hSlvyhL7K3BKHqKX3JnR/Em/rP14q8Lmu3i087IpZ Osw37b02QtB8lSIghPU9A/+qDIpLisjZMu1JC3UJxaJTTMMxhyhyLqg8gO5E1egzIyg5/j PuDN5WGye6KpmPNVtaXQdVhYX+9mYEQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of zhangjiao2@cmss.chinamobile.com designates 111.22.67.151 as permitted sender) smtp.mailfrom=zhangjiao2@cmss.chinamobile.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727405991; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=sNctXJi96vS3inTN7nsaYrkuxRoHo0hcxAkTqIxPTg8=; b=ZpSWMbzBuxnFb+PnqrVFNFvNkQo+WApjihEpDeEC0EOoUPWAwEQREmWjKdTguS02riEOna 2czxCyw3SjNUJj9CCC/DzxZ9lW2evmolLwgGUVLP7l64U8pSEHM8DQx5GIHA4V5u71nDbQ 5VbZFWiKMG45ZpNni8UHHldgneSd/JE= X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app06-12006 (RichMail) with SMTP id 2ee666f61ff9a18-6b2dc; Fri, 27 Sep 2024 11:01:16 +0800 (CST) X-RM-TRANSID: 2ee666f61ff9a18-6b2dc X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.101]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee166f61ffb975-2bc22; Fri, 27 Sep 2024 11:01:16 +0800 (CST) X-RM-TRANSID: 2ee166f61ffb975-2bc22 From: zhangjiao2 To: akpm@linux-foundation.org Cc: shuah@kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, zhang jiao Subject: [PATCH] selftests/mm: Add missing free. Date: Fri, 27 Sep 2024 11:01:14 +0800 Message-Id: <20240927030114.3792-1-zhangjiao2@cmss.chinamobile.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: BDBE914000F X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: sinae9aescuhnd15zy7cqnq4719kxdxg X-HE-Tag: 1727406079-247197 X-HE-Meta: U2FsdGVkX1/daaHsNWxg0p/nnyNIShtlF6lNsyVMAoYXb/TYrX5HAhUPN8kTPIb4ReLgls6NW94cGVx5puIQg7jfxmh7jGoSHpO0ArclkYyhImpBDjmgn1Yarbp+DcZmyoke5NFRw1mSt2jTJmLKYpMHW5ByZOK6WrBe+iOcejrtRi8BBwaLDkP9MTAbqkl4kvUwz3LGpGU0DiWx+yt+kg+GRHmkG37FJnqSC6DlASgVjYpQF4vevBVq2dVkW+xXZkpFB8y5RrV7hdiqYYpzolkW3BhWhFzwT7eaRUCgWjfzncCU45e0Bqo1oAHNjOMpsUOhMCVfSOgEo300bPRQhx7E1n0i/IVzXniLRVHJu1/FItIBNBo5d9btSZbYrORROm0x+K/1bZUQDqu+qcy3bg+HzvTowk9teV74q10n5O4t6b+iOiNxMlDVyTTYXbQfc8aMWgdhueGGq+TfUuvT0vWIFl6iGoZfllFtbrzxKxXbi4pd/FlKYzU1o9UOIUSYxViCo/qKCw2myoAhPIW+uALX0LUj1LQfUTjX3n1Q/q9Zym/yt3oBX0Gu5XfllHLjun81FF19JUI2dBQdyyDipEMnm6bylxIHtUIlw9iTKlX0OyWWlyal0C7xDpOXM415ISRhXc/BgIa3n9C7wE1pXQkLdkBaNUSLz1sG1CZTF+FnrfxYy9khzKKcqresM9Ee008II0OSf+7Fn9HlmcACuqm/b8TgXSADEB1TIDlIt+ATfzfJFYcnXEYQO60OEkZoJPyArTph+1aCg1KkSWp6EAarQXhRwgLvWRFVjVhl0s1XcOmgDsn1tojzMI8ix+ZdICpOZfNMzfQH2iFQBKa0qaKutmut+W0NB/EIEUvMVSIcnz374YyZLvf2lOrhEPkXMqlzYPcZGW5E3RY6B7OEGW4sTxsp+6lOi2DephPK+BZK3owGEvOuUbHxjppxa/u521gHTpUyeURvixaznce 8crq7u6O wR32E9qRdQcXJPEZG+H7TnthOSppOPyq68gi29s92C9p6GZUwqRkmGMNfhQ== 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: List-Subscribe: List-Unsubscribe: From: zhang jiao There is a memory leak in mkdirty, just free src before return. Signed-off-by: zhang jiao --- tools/testing/selftests/mm/mkdirty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c index 1db134063c38..af2fce496912 100644 --- a/tools/testing/selftests/mm/mkdirty.c +++ b/tools/testing/selftests/mm/mkdirty.c @@ -280,6 +280,7 @@ static void test_uffdio_copy(void) dst = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE|MAP_ANON, -1, 0); if (dst == MAP_FAILED) { ksft_test_result_fail("mmap() failed\n"); + free(src); return; }