minios: Error case when unbinding unknown port in xc_evtchn_unbind is
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 1 Aug 2008 08:38:25 +0000 (09:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 1 Aug 2008 08:38:25 +0000 (09:38 +0100)
missing a return statement.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
tools/libxc/xc_minios.c

index f353b9840ce0c9a0559423166aa58cd3f200b866..b1b3c09a480522d382554fd94e15fb6d204d0fca 100644 (file)
@@ -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;