lkdtm: Fix Oops when unloading the module
authorJuerg Haefliger <juerg.haefliger@hpe.com>
Thu, 19 Jan 2017 10:40:13 +0000 (11:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:26:07 +0000 (10:26 +0200)
commitc593091cfc1bee31b56b555c83dc5f0ed715d7ed
treee0e58f7b2377e3af15db953900fb6be949c08733
parent6329973bee29d1f35f72b520076151c72c05d0b4
lkdtm: Fix Oops when unloading the module

[ Upstream commit 9ba60573638e2006170ebcc5489fb1e068afbc8f ]

No jprobe is registered when the module is loaded without specifying a
crashpoint that uses a jprobe. At the moment, we unconditionally try to
unregister the jprobe on module unload which results in an Oops. Add a
check to fix this.

Signed-off-by: Juerg Haefliger <juerg.haefliger@hpe.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/lkdtm_core.c