aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2017-08-10 15:23:50 -0700
committerLinus Torvalds <[email protected]>2017-08-10 15:54:06 -0700
commit4e98ebe5f435fbe5bca91c24bc5d5a2b33025e08 (patch)
treefe38f82632dd87e04472629653b639cd6c6948bf
parent9c56771316ef50992ada284b4c01b03842b2660d (diff)
test_kmod: fix small memory leak on filesystem tests
The break was in the wrong place so file system tests don't work as intended, leaking memory at each test switch. [[email protected]: massaged commit subject, noted memory leak issue without the fix] Link: http://lkml.kernel.org/r/[email protected] Fixes: 39258f448d71 ("kmod: add test driver to stress test the module loader") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Luis R. Rodriguez <[email protected]> Reported-by: David Binderman <[email protected]> Cc: Colin Ian King <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Jessica Yu <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Kees Cook <[email protected]> Cc: Michal Marek <[email protected]> Cc: Miroslav Benes <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--lib/test_kmod.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 1bc06bbfc97a..ff9148969b92 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -746,11 +746,11 @@ static int trigger_config_run_type(struct kmod_test_device *test_dev,
strlen(test_str));
break;
case TEST_KMOD_FS_TYPE:
- break;
kfree_const(config->test_fs);
config->test_driver = NULL;
copied = config_copy_test_fs(config, test_str,
strlen(test_str));
+ break;
default:
mutex_unlock(&test_dev->config_mutex);
return -EINVAL;