Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c593091c authored by Juerg Haefliger's avatar Juerg Haefliger Committed by Greg Kroah-Hartman
Browse files

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: default avatarJuerg Haefliger <juerg.haefliger@hpe.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6329973b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -533,7 +533,9 @@ static void __exit lkdtm_module_exit(void)
	/* Handle test-specific clean-up. */
	lkdtm_usercopy_exit();

	if (lkdtm_jprobe != NULL)
		unregister_jprobe(lkdtm_jprobe);

	pr_info("Crash point unregistered\n");
}