aboutsummaryrefslogtreecommitdiff
path: root/nbd/server.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-21 13:34:45 -0600
committerPaolo Bonzini <pbonzini@redhat.com>2016-08-03 18:44:56 +0200
commit5bee0f4717c4c67394aaade0c5a9cee3d42cc614 (patch)
tree2ddd93bde2f9e56ccd924963709237388bffa006 /nbd/server.c
parent71ae65e552fc6e03572e430009b98b80b40f1c4d (diff)
nbd: Fix bad flag detection on server
Commit ab7c548e added a check for invalid flags, but used an early return on error instead of properly going through the cleanup label. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1469129688-22848-2-git-send-email-eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd/server.c')
-rw-r--r--nbd/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nbd/server.c b/nbd/server.c
index 29e2099b5e..3c1e2b336b 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -1057,7 +1057,8 @@ static ssize_t nbd_co_receive_request(NBDRequest *req,
if (request->type & ~NBD_CMD_MASK_COMMAND & ~NBD_CMD_FLAG_FUA) {
LOG("unsupported flags (got 0x%x)",
request->type & ~NBD_CMD_MASK_COMMAND);
- return -EINVAL;
+ rc = -EINVAL;
+ goto out;
}
rc = 0;