aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorRicardo M. Correia <[email protected]>2009-07-14 15:24:59 -0700
committerBrian Behlendorf <[email protected]>2009-07-14 15:24:59 -0700
commitac95d0974bb36000b979f5b2dd404638ea87baf7 (patch)
tree127970a01da8d6ad0a9a40604c6f2edbdd2b04d5 /include/sys
parente004f04c8b110ee598baa6b86148c8148d737a44 (diff)
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 <[email protected]>
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/debug.h2
1 files changed, 1 insertions, 1 deletions
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)