From patchwork Mon Jan 13 03:28:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hao Ge X-Patchwork-Id: 13936676 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 D1697E77188 for ; Mon, 13 Jan 2025 03:29:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 663D76B008C; Sun, 12 Jan 2025 22:29:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6127F6B0092; Sun, 12 Jan 2025 22:29:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DA776B0093; Sun, 12 Jan 2025 22:29:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 3113B6B008C for ; Sun, 12 Jan 2025 22:29:58 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D953B1C935E for ; Mon, 13 Jan 2025 03:29:57 +0000 (UTC) X-FDA: 83000999634.27.2CF9465 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) by imf12.hostedemail.com (Postfix) with ESMTP id 06D5140007 for ; Mon, 13 Jan 2025 03:29:55 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=E32UpTCP; spf=pass (imf12.hostedemail.com: domain of hao.ge@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=hao.ge@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736738996; a=rsa-sha256; cv=none; b=CrHVI7MMxiCQ61EBjLuSQOaOdameWo7RjBmmEEEbStYVGIUjSDIvtnbkJTlu4z0corHJw3 KwplrYjd7psmz+T2tPCMsU/+mtV0nr0xSjZ9wctugi28Shaybiaekzx19b+Jro92kl4cfD 5qQ6MTdRbbD3qbFw9fXmkq998bNtQxw= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=E32UpTCP; spf=pass (imf12.hostedemail.com: domain of hao.ge@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=hao.ge@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736738996; 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:dkim-signature; bh=X2PZYMbjMztwng0pKClJp1s6F1vIoijyzdKqPaUaI2U=; b=lxl0b2s80qv4MTwkOioPewcm0b6hmuSnJb+kLWRG5Xr643y1e9pUNKNgTbmrdM2ck1MZcX zFH/6yBhQeOEH+t6yEDqlahZHC3kb3zSwgcVcq7ApALCGNK18zzvToJk0Yd5AXxu6WurIG 9yHV9u71lhN8DOhxx3n9JCzlhWb3yGk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736738989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=X2PZYMbjMztwng0pKClJp1s6F1vIoijyzdKqPaUaI2U=; b=E32UpTCPu46MD9WsZcIMek+xEFu8oOaY8IFMzMtaWDaAB2ik9KdUinv06+zpnLPhLG/Pia z43BrmCLRffY7nVF13Ul0ebfdqvcFZPOsQGBqAYhZa01BNy7SAMNBCY3FYtuExaWHsO1pJ iA70r9qLG4gpWkBcMr6yJNa9joPHnW8= From: Hao Ge To: akpm@linux-foundation.org, shuah@kernel.org Cc: sj@kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, hao.ge@linux.dev, Hao Ge Subject: [PATCH] selftests/mm/cow: Modify the incorrect checking parameters Date: Mon, 13 Jan 2025 11:28:58 +0800 Message-Id: <20250113032858.63670-1-hao.ge@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 06D5140007 X-Stat-Signature: kdtwgs9p7yk7c6na6mdmyaamnmwuu7tm X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1736738995-727078 X-HE-Meta: U2FsdGVkX1+cgnQGGgziJgqlVEO0WPntxFi6G066OCHlZpk8wXqK4PLmsDGS3O7mOLUQFswKnrjkvaE9XsoOQ1So9YS9Rj07XR7MvUkrPh8y5wLWMKuzG41dR5TLbytU0seeEFaX294MEUvBpo64XvPaLHH5yxc9Z2Cvr2TLqR7CvhJqrtKiRz3d8/OYruvsde7R0xJG+XmUOQnqa7T9J5C7nvDldnx6ZJaaYa+3RTQrcZhYzp9+Azj6btuW21UxeIIem+Kgji9+LsGnFir5qIQXilqEIxdIjdHUWW73MRAt+uGUuN2+eWsGaR8epUtQqpSxef3jU9tharMW4oSG15NFDgrj+M85XCe+N96BuMZiJBgqiwjuuZwMCCiQ75wjuKcAZg1LAGZmXffNFwyB4J/aQll3msyB0IlOkSI9cZ6YimdgLjscAskK/uYh12zwtqx8NaJA7j/fSc/x8GQyBAPjqvj/QFqCpKXb4satE+Tp6+epTuv5lMAPAz8Wb0VSfBYJWsLvCJS6Vnf359E9rxQ+5om4fz5TDb6k0SkvUMsVvJN3GcDmI9GXB4hrH89C3l85PQL22nv78AJVw60FiR+ZwLG73Vq1jeAtyD1nuBQx5Jc73gsxRXaFkgLReohRH8tg11BKGm+SuohcSflFztsQtYsNxWHV1MPMQ1CbCTzk3JX3nNrlelqr19mCjNPQNg1dUx7iFnCVQZIZwwbQsuDjuzJbKzcg2NdmVdq4UxQzNjaCyuwjW0NKmB+032A+mv3sln+qEeadYJn47B3x8+HEpyqNc9wrL3j+AkzhB62P3kl1eJMAsKut5JVUlKTotwb9y1IJr23nf2DimVF5ybJpahdCr+j25rg5neZ2K0/YbhdVOS4Ur/z7kNkshb8XF1we65FKioV+ftJZFNNi3xDrSrO8i9MS6jCLFEYMbcg7jPRBGubMhf1QiuQqNVgTC6MR+dcdNyaxPy8soKX NVBNXwV/ hPe8NPqwvB1f7xS2XytX2ATf0XtjYW39m1hv5E+GgvtiulTmR8IhYL9Rwv/uC42qvdSlZKLQ+gcvW8nKZ2RvHinNE3ijHW4Kgq1nwGqg73ifFSmaqdQAC9HzJYNlphi57Fv/AqCB2htauJPU= 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: Hao Ge In the run_with_memfd_hugetlb function, some error handle have passed incorrect parameters. It should be "smem", but it was mistakenly written as "mem". Let's fix it. Fixes: baa489fabd01 ("selftests/vm: rename selftests/vm to selftests/mm") Signed-off-by: Hao Ge --- tools/testing/selftests/mm/cow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index 32c6ccc2a6be..7a89680d1566 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -1684,7 +1684,7 @@ static void run_with_memfd_hugetlb(non_anon_test_fn fn, const char *desc, goto close; } smem = mmap(NULL, hugetlbsize, PROT_READ, MAP_SHARED, fd, 0); - if (mem == MAP_FAILED) { + if (smem == MAP_FAILED) { ksft_test_result_fail("mmap() failed\n"); goto munmap; } @@ -1696,7 +1696,7 @@ static void run_with_memfd_hugetlb(non_anon_test_fn fn, const char *desc, fn(mem, smem, hugetlbsize); munmap: munmap(mem, hugetlbsize); - if (mem != MAP_FAILED) + if (smem != MAP_FAILED) munmap(smem, hugetlbsize); close: close(fd);