From 3ce4896345a3c339f159674ddf15e28b5072cb62 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 19 Mar 2014 16:10:57 +0100 Subject: xen: fix error handling Previously, the error KERN_RESOURCE_SHORTAGE was not properly propagated. Found using the Clang Static Analyzer. * xen/block.c (device_open): Fix error handling, remove unused label. * xen/net.c (device_open): Likewise. --- xen/net.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xen/net.c') diff --git a/xen/net.c b/xen/net.c index fb264719..55643651 100644 --- a/xen/net.c +++ b/xen/net.c @@ -568,8 +568,8 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, port = ipc_port_alloc_kernel(); if (port == IP_NULL) { - err = KERN_RESOURCE_SHORTAGE; - goto out; + device_close (nd); + return KERN_RESOURCE_SHORTAGE; } nd->port = port; @@ -582,7 +582,6 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, ipc_port_nsrequest (nd->port, 1, notify, ¬ify); assert (notify == IP_NULL); -out: if (IP_VALID (reply_port)) ds_device_open_reply (reply_port, reply_port_type, D_SUCCESS, dev_to_port(nd)); else -- cgit v1.2.3