mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00: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
1 changed files with 1 additions and 0 deletions
|
@ -1155,6 +1155,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue