Skip to contentSkip to conversation

minios xc_evtchn_unbind missing return

PATCH New Diego Ongaro 1 participant 1 message Jul 31, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios xc_evtchn_unbind missing return

minios: Error case when unbinding unknown port in xc_evtchn_unbind is missing a return statement.

---

tools/libxc/xc_minios.c +4 -1
@@ -259,8 +259,11 @@ int xc_evtchn_unbind(int xce_handle, evt
 	    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;