]> granicus.if.org Git - spl/commitdiff
Fixed NULL dereference by tcd_for_each() when the kmalloc() call in module/spl/spl...
authorRicardo M. Correia <Ricardo.M.Correia@Sun.COM>
Tue, 14 Jul 2009 22:24:59 +0000 (15:24 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 14 Jul 2009 22:24:59 +0000 (15:24 -0700)
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/debug.h

index 1ea1520deed820424666ad995d21449d7e2f3385..f19231b9035f2fbd359247a5eb5aec2b992a3a62 100644 (file)
@@ -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)