Commit dc0ce6cc authored by Dan Carpenter's avatar Dan Carpenter Committed by Luis Chamberlain

lib/test: use after free in register_test_dev_kmod()

The "test_dev" pointer is freed but then returned to the caller.

Fixes: d9c6a72d ("kmod: add test driver to stress test the module loader")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent 13776ebb
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment