aboutsummaryrefslogtreecommitdiff
path: root/block/nbd.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-04-25 16:50:33 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-04-25 18:05:06 +0200
commit92de9012904cd6ada47565f48db545d53069d933 (patch)
tree5335ecbfdc636cd0c6cbe03762904a7389513cee /block/nbd.c
parent4399c438a431effbb785c6c7314b748a4e13734a (diff)
downloadqemu-92de9012904cd6ada47565f48db545d53069d933.zip
qemu-92de9012904cd6ada47565f48db545d53069d933.tar.gz
qemu-92de9012904cd6ada47565f48db545d53069d933.tar.bz2
nbd: Use return values instead of error_is_set(errp)
Using error_is_set(errp) to check whether a function call failed is fragile: it breaks when errp is null. Check perfectly suitable return values instead when possible. errp can't be null there now, but this is more robust and more obviously correct Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/nbd.c')
-rw-r--r--block/nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 5512423..613f258 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -175,7 +175,7 @@ static void nbd_parse_filename(const char *filename, QDict *options,
InetSocketAddress *addr = NULL;
addr = inet_parse(host_spec, errp);
- if (error_is_set(errp)) {
+ if (!addr) {
goto out;
}