]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
lib/test_kmod.c: potential double free in error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Feb 2019 22:20:58 +0000 (14:20 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit4148b6a61f9e08392f5ff43875a9b4d9d885f8a9
treec9516c3f1fdf230e50759511b8dfac77c0b83d6b
parent1e0a98da09109fd2b1fb2a44834c00b226208b57
lib/test_kmod.c: potential double free in error handling

BugLink: https://bugs.launchpad.net/bugs/1837813
[ Upstream commit db7ddeab3ce5d64c9696e70d61f45ea9909cd196 ]

There is a copy and paste bug so we set "config->test_driver" to NULL
twice instead of setting "config->test_fs".  Smatch complains that it
leads to a double free:

  lib/test_kmod.c:840 __kmod_config_init() warn: 'config->test_fs' double freed

Link: http://lkml.kernel.org/r/20190121140011.GA14283@kadam
Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the module loader")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
lib/test_kmod.c