linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] selftests/mm/cow: Fix the incorrect error handling
@ 2025-03-12  4:38 Cyan Yang
  2025-03-12  4:58 ` Dev Jain
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cyan Yang @ 2025-03-12  4:38 UTC (permalink / raw)
  To: akpm, shuah, david; +Cc: linux-mm, linux-kselftest, linux-kernel, Cyan Yang

There is an error handling did not check the correct return value.
This patch will fix it.

Fixes: f4b5fd6946e244cdedc3bbb9a1f24c8133b2077a ("selftests/vm: anon_cow: THP tests")
Signed-off-by: Cyan Yang <cyan.yang@sifive.com>
---
 tools/testing/selftests/mm/cow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
index 9446673645eb..f0cb14ea8608 100644
--- a/tools/testing/selftests/mm/cow.c
+++ b/tools/testing/selftests/mm/cow.c
@@ -876,7 +876,7 @@ static void do_run_with_thp(test_fn fn, enum thp_run thp_run, size_t thpsize)
 		mremap_size = thpsize / 2;
 		mremap_mem = mmap(NULL, mremap_size, PROT_NONE,
 				  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-		if (mem == MAP_FAILED) {
+		if (mremap_mem == MAP_FAILED) {
 			ksft_test_result_fail("mmap() failed\n");
 			goto munmap;
 		}
-- 
2.39.5 (Apple Git-154)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] selftests/mm/cow: Fix the incorrect error handling
  2025-03-12  4:38 [PATCH v2] selftests/mm/cow: Fix the incorrect error handling Cyan Yang
@ 2025-03-12  4:58 ` Dev Jain
  2025-03-12 17:35 ` Markus Elfring
  2025-03-15 19:06 ` Muhammad Usama Anjum
  2 siblings, 0 replies; 4+ messages in thread
From: Dev Jain @ 2025-03-12  4:58 UTC (permalink / raw)
  To: Cyan Yang, akpm, shuah, david; +Cc: linux-mm, linux-kselftest, linux-kernel



On 12/03/25 10:08 am, Cyan Yang wrote:
> There is an error handling did not check the correct return value.
> This patch will fix it.
> 
> Fixes: f4b5fd6946e244cdedc3bbb9a1f24c8133b2077a ("selftests/vm: anon_cow: THP tests")
> Signed-off-by: Cyan Yang <cyan.yang@sifive.com>

Reviewed-by: Dev Jain <dev.jain@arm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] selftests/mm/cow: Fix the incorrect error handling
  2025-03-12  4:38 [PATCH v2] selftests/mm/cow: Fix the incorrect error handling Cyan Yang
  2025-03-12  4:58 ` Dev Jain
@ 2025-03-12 17:35 ` Markus Elfring
  2025-03-15 19:06 ` Muhammad Usama Anjum
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2025-03-12 17:35 UTC (permalink / raw)
  To: Cyan Yang, linux-kselftest, linux-mm
  Cc: LKML, Andrew Morton, David Hildenbrand, Dev Jain, Shuah Khan

…
> This patch will fix it.

Will an imperative wording be more desirable for such a change description?
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc6#n94

Regards,
Markus


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] selftests/mm/cow: Fix the incorrect error handling
  2025-03-12  4:38 [PATCH v2] selftests/mm/cow: Fix the incorrect error handling Cyan Yang
  2025-03-12  4:58 ` Dev Jain
  2025-03-12 17:35 ` Markus Elfring
@ 2025-03-15 19:06 ` Muhammad Usama Anjum
  2 siblings, 0 replies; 4+ messages in thread
From: Muhammad Usama Anjum @ 2025-03-15 19:06 UTC (permalink / raw)
  To: Cyan Yang, akpm, shuah, david; +Cc: linux-mm, linux-kselftest, linux-kernel

On 3/12/25 9:38 AM, Cyan Yang wrote:
> There is an error handling did not check the correct return value.
> This patch will fix it.
> 
> Fixes: f4b5fd6946e244cdedc3bbb9a1f24c8133b2077a ("selftests/vm: anon_cow: THP tests")
> Signed-off-by: Cyan Yang <cyan.yang@sifive.com>
After improving the description:
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
>  tools/testing/selftests/mm/cow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
> index 9446673645eb..f0cb14ea8608 100644
> --- a/tools/testing/selftests/mm/cow.c
> +++ b/tools/testing/selftests/mm/cow.c
> @@ -876,7 +876,7 @@ static void do_run_with_thp(test_fn fn, enum thp_run thp_run, size_t thpsize)
>  		mremap_size = thpsize / 2;
>  		mremap_mem = mmap(NULL, mremap_size, PROT_NONE,
>  				  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
> -		if (mem == MAP_FAILED) {
> +		if (mremap_mem == MAP_FAILED) {
>  			ksft_test_result_fail("mmap() failed\n");
>  			goto munmap;
>  		}


-- 
Regards,
Usama


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-15 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-12  4:38 [PATCH v2] selftests/mm/cow: Fix the incorrect error handling Cyan Yang
2025-03-12  4:58 ` Dev Jain
2025-03-12 17:35 ` Markus Elfring
2025-03-15 19:06 ` Muhammad Usama Anjum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox