Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH 1/4] selftests: kmod: Use variable NAME in kmod_test_0001()
@ 2020-04-18  5:19 Tiezhu Yang
  2020-04-18  5:19 ` [PATCH 2/4] kmod: Remove redundant "be an" in the comment Tiezhu Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Tiezhu Yang @ 2020-04-18  5:19 UTC (permalink / raw)
  To: Luis Chamberlain, Shuah Khan; +Cc: linux-kselftest, linux-kernel, Xuefeng Li

Use the variable NAME instead of "\000" directly in kmod_test_0001().

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 tools/testing/selftests/kmod/kmod.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/kmod/kmod.sh b/tools/testing/selftests/kmod/kmod.sh
index 3702dbc..da60c3b 100755
--- a/tools/testing/selftests/kmod/kmod.sh
+++ b/tools/testing/selftests/kmod/kmod.sh
@@ -341,7 +341,7 @@ kmod_test_0001_driver()
 
 	kmod_defaults_driver
 	config_num_threads 1
-	printf '\000' >"$DIR"/config_test_driver
+	printf $NAME >"$DIR"/config_test_driver
 	config_trigger ${FUNCNAME[0]}
 	config_expect_result ${FUNCNAME[0]} MODULE_NOT_FOUND
 }
@@ -352,7 +352,7 @@ kmod_test_0001_fs()
 
 	kmod_defaults_fs
 	config_num_threads 1
-	printf '\000' >"$DIR"/config_test_fs
+	printf $NAME >"$DIR"/config_test_fs
 	config_trigger ${FUNCNAME[0]}
 	config_expect_result ${FUNCNAME[0]} -EINVAL
 }
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* Re: [PATCH 4/4] test_kmod: Avoid potential double free in trigger_config_run_type()
@ 2020-04-18 17:23 Markus Elfring
  2020-04-20  1:07 ` Tiezhu Yang
  0 siblings, 1 reply; 15+ messages in thread
From: Markus Elfring @ 2020-04-18 17:23 UTC (permalink / raw)
  To: Tiezhu Yang, linux-kselftest
  Cc: linux-kernel, Luis Chamberlain, Shuah Khan, Xuefeng Li

> It should set config->test_fs instead of config->test_driver as NULL
> after kfree_const(config->test_fs) to avoid potential double free.

I suggest to improve this change description.

* How do you think about a wording variant like the following?

  Reset the member “test_fs” of the test configuration after a call
  of the function “kfree_const” to a null pointer so that a double
  memory release will not be performed.

* Would you like to add the tag “Fixes”?

Regards,
Markus

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

end of thread, other threads:[~2020-04-20  4:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-18  5:19 [PATCH 1/4] selftests: kmod: Use variable NAME in kmod_test_0001() Tiezhu Yang
2020-04-18  5:19 ` [PATCH 2/4] kmod: Remove redundant "be an" in the comment Tiezhu Yang
2020-04-18  5:47   ` Luis Chamberlain
2020-04-18  5:19 ` [PATCH 3/4] kmod: Return directly if module name is empty in request_module() Tiezhu Yang
2020-04-18  5:45   ` Luis Chamberlain
2020-04-18  5:48     ` Luis Chamberlain
2020-04-18  5:58       ` Tiezhu Yang
2020-04-18  7:19         ` Luis Chamberlain
2020-04-20  4:08           ` Tiezhu Yang
2020-04-20  4:11             ` Tiezhu Yang
2020-04-18  5:20 ` [PATCH 4/4] test_kmod: Avoid potential double free in trigger_config_run_type() Tiezhu Yang
2020-04-18  5:47   ` Luis Chamberlain
2020-04-18  5:46 ` [PATCH 1/4] selftests: kmod: Use variable NAME in kmod_test_0001() Luis Chamberlain
  -- strict thread matches above, loose matches on Subject: below --
2020-04-18 17:23 [PATCH 4/4] test_kmod: Avoid potential double free in trigger_config_run_type() Markus Elfring
2020-04-20  1:07 ` Tiezhu Yang

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