diff options
author | Michael Tokarev <mjt@tls.msk.ru> | 2014-10-30 11:00:01 +0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2014-11-02 10:04:34 +0300 |
commit | 6af76c6f7dbcc6255f5a5cac20ad61d1492d4052 (patch) | |
tree | bfa912780a87f47b5a8aeb5f2dc6f5679d78c23c /hw/9pfs | |
parent | 660edd4eda903e32811a4929d1434cceda3284aa (diff) |
virtio-9p-proxy: fix error return in proxy_init()
proxy_init() does not check the return value of connect_namedsocket(),
fix this by rearranging code a little bit.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/9pfs')
-rw-r--r-- | hw/9pfs/virtio-9p-proxy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c index e6bbb06319..2ec211bbea 100644 --- a/hw/9pfs/virtio-9p-proxy.c +++ b/hw/9pfs/virtio-9p-proxy.c @@ -1155,10 +1155,12 @@ static int proxy_init(FsContext *ctx) sock_id = atoi(ctx->fs_root); if (sock_id < 0) { fprintf(stderr, "socket descriptor not initialized\n"); - g_free(proxy); - return -1; } } + if (sock_id < 0) { + g_free(proxy); + return -1; + } g_free(ctx->fs_root); ctx->fs_root = NULL; |