Skip to content

Commit

Permalink
lib/test_kmod.c: fix rmmod double free
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Luis Chamberlain <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Cc: <[email protected]>	[4.12+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mcgrof authored and torvalds committed Nov 30, 2018
1 parent c7d7d62 commit 5618cf0
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/test_kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5618cf0

Please sign in to comment.