From: Ian Campbell Subject: Re: [PATCH 08/12] device-tree: get_val cannot cope with cells > 2, add a BUG Date: Thu, 29 Nov 2012 17:14:39 +0000 Message-ID: <1354209279.6269.49.camel@zakaz.uk.xensource.com> References: <1352823779.7491.94.camel@zakaz.uk.xensource.com> <1352823804-28482-8-git-send-email-ian.campbell@citrix.com> <20121129170946.GH80627@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121129170946.GH80627@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2012-11-29 at 17:09 +0000, Tim Deegan wrote: > At 16:23 +0000 on 13 Nov (1352823800), Ian Campbell wrote: > > Signed-off-by: Ian Campbell > > --- > > v2: drop unrelated white space fixup > > --- > > xen/common/device_tree.c | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c > > index efd1663..7d3fd9f 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 ); > > + > > If this is caused by a malformed DTB (rather than a Xen bug), I think > this should be an early_panic() or similar. I agree, will change. > > > while ( cells-- ) > > { > > *val <<= 32; > > -- > > 1.7.9.1 > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xen.org > > http://lists.xen.org/xen-devel