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
Unified · Split
| @@ -632,7 +632,7 @@ static void __kmod_config_free(struct test_config *config) · 631 unmodified lines | |||
| 632 | config->test_driver = NULL; | 632 | config->test_driver = NULL; |
| 633 | 633 | ||
| 634 | kfree_const(config->test_fs); | 634 | kfree_const(config->test_fs); |
| 635 | config->test_driver = NULL; | 635 | config->test_fs = NULL; |
| 636 | } | 636 | } |
| 637 | 637 | ||
| 638 | static void kmod_config_free(struct kmod_test_device *test_dev) | 638 | static void kmod_config_free(struct kmod_test_device *test_dev) |