From de3801ce0b14fb8bfbb8bd686a8f45417acdd8d1 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 4 Dec 2006 11:08:18 +0000 Subject: [PATCH] Erik Habbinga I've seen a case where TRACE_BUFFER is called with a NULL buffer pointer. This patch adds a check to debug_print_buffer in scst_debug.c to avoid dereferencing any incoming NULL pointers. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@43 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst_debug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scst/include/scst_debug.c b/scst/include/scst_debug.c index 898a69351..b2e4943a0 100644 --- a/scst/include/scst_debug.c +++ b/scst/include/scst_debug.c @@ -57,6 +57,9 @@ void debug_print_buffer(const void *data, int len) int f = 0; unsigned long flags; + if (buf == NULL) + return; + spin_lock_irqsave(&trace_buf_lock, flags); PRINT(NO_FLAG, " (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F");