mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
lib/test: use after free in register_test_dev_kmod()
The "test_dev" pointer is freed but then returned to the caller.
Fixes: d9c6a72d6f ("kmod: add test driver to stress test the module loader")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
This commit is contained in:
1 parent
13776ebb99
commit
dc0ce6cc4b
1 file changed
+1
@@ -1149,6 +1149,7 @@ static struct kmod_test_device *register_test_dev_kmod(void)
|
||||
if (ret) {
|
||||
pr_err("could not register misc device: %d\n", ret);
|
||||
free_test_dev_kmod(test_dev);
|
||||
test_dev = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user