History

lib/test_kmod.c: potential double free in error handling

There is a copy and paste bug so we set "config->test_driver" to NULL twice instead of setting "config->test_fs". Smatch complains that it leads to a double free: lib/test_kmod.c:840 __kmod_config_init() warn: 'config->test_fs' double freed

Dan Carpenter committed 7 years ago

Commit db7ddea1 parent cefc7ef1 file · +1 −1Browse files

Unified · Split

lib/test_kmod.c+1−1
@@ -632,7 +632,7 @@ static void __kmod_config_free(struct test_config *config) · 631 unmodified lines
632632 config->test_driver = NULL;
633633
634634 kfree_const(config->test_fs);
635− config->test_driver = NULL;
635+ config->test_fs = NULL;
636636 }
637637
638638 static void kmod_config_free(struct kmod_test_device *test_dev)