Skip to contentSkip to conversation

lib/test_kmod.c: fix rmmod double free

PATCH New [email protected] 1 participant 1 message Dec 1, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 10/31 lib/test_kmod.c: fix rmmod double free

From: Luis Chamberlain <[email protected]>
Subject: 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.

---

 lib/test_kmod.c |    1 -
 1 file changed, 1 deletion(-)
lib/test_kmod.c renamed from lib/test_kmod.c~test_kmod-fix-rmmod-double-free +0 -1
@@ -1214,7 +1214,6 @@ void unregister_test_dev_kmod(struct kmo
 
 	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);

_