From a0e36ccf9eadde9d8458b3490b2ec62cf8b1ec2c Mon Sep 17 00:00:00 2001 From: sborrill Date: Fri, 22 May 2015 11:44:25 +0000 Subject: [PATCH] Pull up the following revisions(s) (requested by bouyer in ticket #1965): sys/arch/xen/xen/xenevt.c: revision 1.42 Fix off by one error, addresses port-xen/49919. --- sys/arch/xen/xen/xenevt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/arch/xen/xen/xenevt.c b/sys/arch/xen/xen/xenevt.c index 4effba9befe51..a8671858f51c7 100644 --- a/sys/arch/xen/xen/xenevt.c +++ b/sys/arch/xen/xen/xenevt.c @@ -1,4 +1,4 @@ -/* $NetBSD: xenevt.c,v 1.29.4.2 2009/09/30 00:08:03 snj Exp $ */ +/* $NetBSD: xenevt.c,v 1.29.4.2.6.1 2015/05/22 11:44:25 sborrill Exp $ */ /* * Copyright (c) 2005 Manuel Bouyer. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.29.4.2 2009/09/30 00:08:03 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.29.4.2.6.1 2015/05/22 11:44:25 sborrill Exp $"); #include "opt_xen.h" #include @@ -496,7 +496,7 @@ xenevt_fwrite(struct file *fp, off_t *offp, struct uio *uio, if (uio->uio_resid == 0) return (0); nentries = uio->uio_resid / sizeof(uint16_t); - if (nentries > NR_EVENT_CHANNELS) + if (nentries >= NR_EVENT_CHANNELS) return EMSGSIZE; chans = kmem_alloc(nentries * sizeof(uint16_t), KM_SLEEP); if (chans == NULL) @@ -580,7 +580,7 @@ xenevt_fioctl(struct file *fp, u_long cmd, void *addr) { struct ioctl_evtchn_unbind *unbind = addr; - if (unbind->port > NR_EVENT_CHANNELS) + if (unbind->port >= NR_EVENT_CHANNELS) return EINVAL; if (devevent[unbind->port] != d) return ENOTCONN; @@ -596,7 +596,7 @@ xenevt_fioctl(struct file *fp, u_long cmd, void *addr) { struct ioctl_evtchn_notify *notify = addr; - if (notify->port > NR_EVENT_CHANNELS) + if (notify->port >= NR_EVENT_CHANNELS) return EINVAL; if (devevent[notify->port] != d) return ENOTCONN;