From ac95d0974bb36000b979f5b2dd404638ea87baf7 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 14 Jul 2009 15:24:59 -0700 Subject: [PATCH] Fixed NULL dereference by tcd_for_each() when the kmalloc() call in module/spl/spl-debug.c:1163 returns NULL. Signed-off-by: Brian Behlendorf --- include/sys/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sys/debug.h b/include/sys/debug.h index 1ea1520deed..f19231b9035 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -173,7 +173,7 @@ union trace_data_union { extern union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS]; #define tcd_for_each(tcd, i, j) \ - for (i = 0; i < TCD_TYPE_MAX; i++) \ + for (i = 0; i < TCD_TYPE_MAX && trace_data[i]; i++) \ for (j = 0, ((tcd) = &(*trace_data[i])[j].tcd); \ j < num_possible_cpus(); j++, (tcd) = &(*trace_data[i])[j].tcd) -- 2.45.2