From: Ricardo M. Correia Date: Tue, 14 Jul 2009 22:24:59 +0000 (-0700) Subject: Fixed NULL dereference by tcd_for_each() when the kmalloc() call in module/spl/spl... X-Git-Tag: spl-0.4.5~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac95d0974bb36000b979f5b2dd404638ea87baf7;p=spl 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 --- diff --git a/include/sys/debug.h b/include/sys/debug.h index 1ea1520..f19231b 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)