From 0ae64c2ff81fb618af29ca56b5fdc4fbcdaf9dcb Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 1 Aug 2008 09:38:25 +0100 Subject: [PATCH] minios: Error case when unbinding unknown port in xc_evtchn_unbind is missing a return statement. Signed-off-by: Diego Ongaro --- tools/libxc/xc_minios.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c index f353b9840c..b1b3c09a48 100644 --- a/tools/libxc/xc_minios.c +++ b/tools/libxc/xc_minios.c @@ -259,8 +259,11 @@ int xc_evtchn_unbind(int xce_handle, evtchn_port_t port) files[xce_handle].evtchn.ports[i].port = -1; break; } - if (i == MAX_EVTCHN_PORTS) + if (i == MAX_EVTCHN_PORTS) { printf("Warning: couldn't find port %"PRId32" for xc handle %x\n", port, xce_handle); + errno = -EINVAL; + return -1; + } files[xce_handle].evtchn.ports[i].bound = 0; unbind_evtchn(port); return 0; -- 2.30.2