projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cefc7ef
)
lib/test_kmod.c: potential double free in error handling
author
Dan Carpenter
<
[email protected]
>
Fri, 1 Feb 2019 22:20:58 +0000
(14:20 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 1 Feb 2019 23:46:23 +0000
(15:46 -0800)
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
Link:
http://lkml.kernel.org/r/20190121140011.GA14283@kadam
Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the module loader")
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: Luis Chamberlain <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/test_kmod.c
patch
|
blob
|
history
diff --git
a/lib/test_kmod.c
b/lib/test_kmod.c
index d82d022111e0e5321ef17cff105e1e87bc90ba0e..9cf77628fc913e0e63ae29e843c34f6a685e9f3d 100644
(file)
--- a/
lib/test_kmod.c
+++ b/
lib/test_kmod.c
@@
-632,7
+632,7
@@
static void __kmod_config_free(struct test_config *config)
config->test_driver = NULL;
kfree_const(config->test_fs);
- config->test_
driver
= NULL;
+ config->test_
fs
= NULL;
}
static void kmod_config_free(struct kmod_test_device *test_dev)