From 313140cbb12019660e435dfbb4f2886df269830c Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 21 Jan 2013 12:40:28 +0000 Subject: [PATCH] device-tree: get_val cannot cope with cells > 2, add early_panic Signed-off-by: Ian Campbell Acked-by: Tim Deegan Committed-by: Ian Campbell --- xen/common/device_tree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 8b4ef2f45c..260c2d4862 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -84,6 +84,9 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val) { *val = 0; + if ( cells > 2 ) + early_panic("dtb value contains > 2 cells\n"); + while ( cells-- ) { *val <<= 32; -- 2.30.2