aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/color.c
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2012-03-28 00:29:18 -0400
committerChristopher Kenna <cjk@cs.unc.edu>2012-03-28 00:29:18 -0400
commita812f8c03abe7e6952af99ee6f0129e61b91c23f (patch)
treee658aec8dbe7edc69ecc02f7f6e46e5a4a468d48 /litmus/color.c
parent114cd359b110e24d7fdf303fa96c09bf7fad875e (diff)
don't crash when cache information unavailable
Diffstat (limited to 'litmus/color.c')
-rw-r--r--litmus/color.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/litmus/color.c b/litmus/color.c
index 2a942d22a676..c3e2a1072360 100644
--- a/litmus/color.c
+++ b/litmus/color.c
@@ -69,10 +69,13 @@ static int __init init_color(void)
69 MPRINT("Cache size: %lu line-size: %lu ways: %lu sets: %lu\n", 69 MPRINT("Cache size: %lu line-size: %lu ways: %lu sets: %lu\n",
70 color_cache_info.size, color_cache_info.line_size, 70 color_cache_info.size, color_cache_info.line_size,
71 color_cache_info.ways, color_cache_info.sets); 71 color_cache_info.ways, color_cache_info.sets);
72 if (!color_cache_info.size){
73 printk(KERN_WARNING "No cache information found.\n");
74 return -EINVAL;
75 }
72 BUG_ON(color_cache_info.size <= 1048576 || 76 BUG_ON(color_cache_info.size <= 1048576 ||
73 color_cache_info.ways < 15 || 77 color_cache_info.ways < 15 ||
74 color_cache_info.line_size != 64 || 78 color_cache_info.line_size != 64);
75 color_cache_info.sets < 4096);
76 setup_mask(); 79 setup_mask();
77 return init_color_lists(); 80 return init_color_lists();
78} 81}