From: Konrad Rzeszutek Wilk Date: Thu, 29 Sep 2011 17:09:34 +0000 (-0400) Subject: xen/p2m/debugfs: Fix potential pointer exception. X-Git-Tag: v2.6.39-400.9.0~854^2~7^2~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bbd61fb34cc0cdf4143f8b328a6e30c65628c6e5;p=users%2Fjedix%2Flinux-maple.git xen/p2m/debugfs: Fix potential pointer exception. We could be referencing the last + 1 element of level_name[] array which would cause a pointer exception, because of the initial setup of lvl=4. [v1: No need to do this for type_name, pointed out by Ian Campbell] Signed-off-by: Konrad Rzeszutek Wilk --- diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 58efeb9d5440..2e3bf7a0732b 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -786,7 +786,7 @@ EXPORT_SYMBOL_GPL(m2p_find_override_pfn); int p2m_dump_show(struct seq_file *m, void *v) { static const char * const level_name[] = { "top", "middle", - "entry", "abnormal" }; + "entry", "abnormal", "error"}; static const char * const type_name[] = { "identity", "missing", "pfn", "abnormal"}; #define TYPE_IDENTITY 0