lib/test_kmod.c: fix rmmod double free
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 30 Nov 2018 22:09:21 +0000 (14:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 18:32:13 +0000 (19:32 +0100)
commit91a51478835664b2b7e8d136474c887c9e52ddb4
tree9d58b01650cff38a98d184a5759e7b7cf26a4c46
parent855f9dc87160f9351291cbe52056fa08529532d3
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>
lib/test_kmod.c