[PULL,088/111] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()
diff mbox series

Message ID 20200123115841.138849-89-dgilbert@redhat.com
State New
Headers show
Series
  • virtiofs queue
Related show

Commit Message

Dr. David Alan Gilbert Jan. 23, 2020, 11:58 a.m. UTC
From: Stefan Hajnoczi <stefanha@redhat.com>

vu_socket_path is NULL when --fd=FDNUM was used.  Use
fuse_lowlevel_is_virtio() instead.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index 70568d22a4..dab6a31e08 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -2537,12 +2537,13 @@  void fuse_session_destroy(struct fuse_session *se)
         close(se->fd);
     }
 
-    if (se->vu_socket_path) {
+    if (fuse_lowlevel_is_virtio(se)) {
         virtio_session_close(se);
-        free(se->vu_socket_path);
-        se->vu_socket_path = NULL;
     }
 
+    free(se->vu_socket_path);
+    se->vu_socket_path = NULL;
+
     free(se);
 }