From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 13/16] device-tree: get_val cannot cope with cells > 2, add a BUG Date: Mon, 3 Sep 2012 13:30:53 +0000 Message-ID: <1346679056-8108-13-git-send-email-ian.campbell@citrix.com> References: <1346678886.32462.9.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1346678886.32462.9.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell --- xen/common/device_tree.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 226e3f3..60f3a03 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -45,6 +45,8 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val) { *val = 0; + BUG_ON( cells > 2 ); + while ( cells-- ) { *val <<= 32; @@ -139,7 +141,7 @@ int device_tree_for_each_node(const void *fdt, */ const char *device_tree_bootargs(const void *fdt) { - int node; + int node; const struct fdt_property *prop; node = fdt_path_offset(fdt, "/chosen"); -- 1.7.9.1