From 2159145a00dcc48c3dc06a84321cf45aadcaf081 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 30 Jun 2014 12:55:08 -0500 Subject: [PATCH] Fix kernel crash by handling error condition better at startup. * runtime/linux/runtime.h (init_module): If systemtap_kernel_module_init() fails, be sure to close the transport. --- runtime/linux/runtime.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h index ec792d62d..af8ab2470 100644 --- a/runtime/linux/runtime.h +++ b/runtime/linux/runtime.h @@ -307,7 +307,10 @@ int init_module (void) rc = _stp_transport_init(); if (rc) return rc; - return systemtap_kernel_module_init(); + rc = systemtap_kernel_module_init(); + if (rc) + _stp_transport_close(); + return rc; } static void systemtap_kernel_module_exit (void); -- 2.43.5