From ac95d0974bb36000b979f5b2dd404638ea87baf7 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 14 Jul 2009 15:24:59 -0700 Subject: 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(-) (limited to 'include/sys') diff --git a/include/sys/debug.h b/include/sys/debug.h index 1ea1520de..f19231b90 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) -- cgit v1.2.3