summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2018-11-30 14:09:21 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-05 19:41:26 +0100
commit397dbde6149057b4b84acb37012b57801fbc9221 (patch)
treeae59e5ec104a7d4d80245ac48d2e4bfc1144d469 /lib
parentd08c62878fe2040e2cbc70554f86c54895a9f708 (diff)
downloadlinux-stable-397dbde6149057b4b84acb37012b57801fbc9221.tar.gz
linux-stable-397dbde6149057b4b84acb37012b57801fbc9221.tar.bz2
linux-stable-397dbde6149057b4b84acb37012b57801fbc9221.zip
lib/test_kmod.c: fix rmmod double free
commit 5618cf031fecda63847cafd1091e7b8bd626cdb1 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/test_kmod.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 96c304fd656a..7abb59ce6613 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -1221,7 +1221,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);