The break was in the wrong place so file system tests don't work as intended, leaking memory at each test switch. [mcgrof@kernel.org: massaged commit subject, noted memory leak issue without the fix] Link: http://lkml.kernel.org/r/20170802211450.27928-6-mcgrof@kernel.org Fixes: 39258f448d71 ("kmod: add test driver to stress test the module loader") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> Reported-by: David Binderman <dcb314@hotmail.com> Cc: Colin Ian King <colin.king@canonical.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Jessica Yu <jeyu@redhat.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Kees Cook <keescook@chromium.org> Cc: Michal Marek <mmarek@suse.com> Cc: Miroslav Benes <mbenes@suse.cz> Cc: Petr Mladek <pmladek@suse.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing the changes to lib (1 of 1 file). Show all
Unified · Split
| @@ -746,11 +746,11 @@ static int trigger_config_run_type(struct kmod_test_device *test_dev, · 745 unmodified lines | ||
| 746 | 746 | strlen(test_str)); |
| 747 | 747 | break; |
| 748 | 748 | case TEST_KMOD_FS_TYPE: |
| 749 | − break; | |
| 750 | 749 | kfree_const(config->test_fs); |
| 751 | 750 | config->test_driver = NULL; |
| 752 | 751 | copied = config_copy_test_fs(config, test_str, |
| 753 | 752 | strlen(test_str)); |
| 753 | + break; | |
| 754 | 754 | default: |
| 755 | 755 | mutex_unlock(&test_dev->config_mutex); |
| 756 | 756 | return -EINVAL; |