]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen/p2m/debugfs: Fix potential pointer exception.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 29 Sep 2011 17:09:34 +0000 (13:09 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 29 Sep 2011 18:33:32 +0000 (14:33 -0400)
We could be referencing the last + 1 element of level_name[]
array which would cause a pointer exception.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
arch/x86/xen/p2m.c

index 58efeb9d5440b75d2fd6d3cb5880f4ddd2729130..bc4cf0a710ac5daf29c09edf0ae1c42613a06797 100644 (file)
@@ -786,9 +786,9 @@ 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", NULL};
        static const char * const type_name[] = { "identity", "missing",
-                                               "pfn", "abnormal"};
+                                               "pfn", "abnormal", NULL};
 #define TYPE_IDENTITY 0
 #define TYPE_MISSING 1
 #define TYPE_PFN 2