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 <dan.carpenter@oracle.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
This commit is contained in:
parent
13776ebb99
commit
dc0ce6cc4b
|
@ -1149,6 +1149,7 @@ static struct kmod_test_device *register_test_dev_kmod(void)
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("could not register misc device: %d\n", ret);
|
pr_err("could not register misc device: %d\n", ret);
|
||||||
free_test_dev_kmod(test_dev);
|
free_test_dev_kmod(test_dev);
|
||||||
|
test_dev = NULL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue