mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 09:12:07 +00:00
lib/test_kmod.c: fix rmmod double free
We free the misc device string twice on rmmod; fix this. Without this we cannot remove the module without crashing. Link: http://lkml.kernel.org/r/20181124050500.5257-1-mcgrof@kernel.org Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Reported-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: <stable@vger.kernel.org> [4.12+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c7d7d620dc
commit
5618cf031f
@ -1214,7 +1214,6 @@ void unregister_test_dev_kmod(struct kmod_test_device *test_dev)
|
||||
|
||||
dev_info(test_dev->dev, "removing interface\n");
|
||||
misc_deregister(&test_dev->misc_dev);
|
||||
kfree(&test_dev->misc_dev.name);
|
||||
|
||||
mutex_unlock(&test_dev->config_mutex);
|
||||
mutex_unlock(&test_dev->trigger_mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user