diff options
author | Greg Kurz <groug@kaod.org> | 2019-10-10 11:36:04 +0200 |
---|---|---|
committer | Greg Kurz <groug@kaod.org> | 2019-10-10 11:36:04 +0200 |
commit | c0da0cb7614db9a6ba6e8f00cea4c86844bb3e22 (patch) | |
tree | 5eea5b0668aeff1c08178a88f34b632080f21c50 /hw/9pfs/9p-proxy.c | |
parent | 870328335286385b5a78ba7d925b46dc5ba74d7f (diff) | |
download | qemu-c0da0cb7614db9a6ba6e8f00cea4c86844bb3e22.zip qemu-c0da0cb7614db9a6ba6e8f00cea4c86844bb3e22.tar.gz qemu-c0da0cb7614db9a6ba6e8f00cea4c86844bb3e22.tar.bz2 |
9p: Simplify error path of v9fs_device_realize_common()
Make v9fs_device_unrealize_common() idempotent and use it for rollback,
in order to reduce code duplication.
Signed-off-by: Greg Kurz <groug@kaod.org>
Diffstat (limited to 'hw/9pfs/9p-proxy.c')
-rw-r--r-- | hw/9pfs/9p-proxy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 57a8c1c..97ab9c5 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1185,6 +1185,10 @@ static void proxy_cleanup(FsContext *ctx) { V9fsProxy *proxy = ctx->private; + if (!proxy) { + return; + } + g_free(proxy->out_iovec.iov_base); g_free(proxy->in_iovec.iov_base); if (ctx->export_flags & V9FS_PROXY_SOCK_NAME) { |