From: Tim Deegan Subject: [PATCH] sched/arinc653: fix another unsigned < 0 comparison Date: Wed, 8 Dec 2010 11:59:03 +0000 Message-ID: <20101208115903.GE9912@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: George Dunlap , Josh Holtrop List-Id: xen-devel@lists.xenproject.org sched/arinc653: fix another unsigned < 0 comparison replacing it with a test of the appopriate unsigned max. Signed-off-by:Tim Deegan diff -r 89116f28083f -r a107be26c1fc xen/common/sched_arinc653.c --- a/xen/common/sched_arinc653.c Wed Dec 08 10:46:31 2010 +0000 +++ b/xen/common/sched_arinc653.c Wed Dec 08 11:55:40 2010 +0000 @@ -241,7 +241,7 @@ arinc653_sched_set( found_dom0 = 1; /* Check for a valid VCPU ID and run time. */ - if ( (schedule->sched_entries[i].vcpu_id < 0) + if ( (schedule->sched_entries[i].vcpu_id >= MAX_VIRT_CPUS) || (schedule->sched_entries[i].runtime <= 0) ) goto fail;