diff --git a/drivers/gpu/nvgpu/os/posix/bug.c b/drivers/gpu/nvgpu/os/posix/bug.c index 64f4a6f63..cf5b36bc1 100644 --- a/drivers/gpu/nvgpu/os/posix/bug.c +++ b/drivers/gpu/nvgpu/os/posix/bug.c @@ -21,17 +21,9 @@ */ #include - #include - -__attribute__ ((noreturn)) -static void __hang(void) -{ - nvgpu_err(NULL, "Hanging!"); - - while (1) - ; -} +#include +#include static void __dump_stack(unsigned int skip_frames) { @@ -50,7 +42,9 @@ void __bug(const char *fmt, ...) { nvgpu_err(NULL, "BUG detected!"); - __hang(); + /* Raise a bad system call signal and kill the thread */ + (void) raise(SIGSEGV); + pthread_exit(NULL); } bool __warn(bool cond, const char *fmt, ...)