mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
lib/test: use after free in register_test_dev_kmod()
[ Upstream commitdc0ce6cc4b] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
00d2b9fe5e
commit
327f07e370
|
|
@ -1155,6 +1155,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
Block a user