All of lore.kernel.org
 help / color / mirror / Atom feed
* [Virtio-fs] [PATCH] Virtiofsd: fix segfault when quit before dev init
@ 2019-08-03  5:28 Liu Bo
  2019-08-04  3:15 ` piaojun
  2019-08-05 11:18 ` Dr. David Alan Gilbert
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Bo @ 2019-08-03  5:28 UTC (permalink / raw)
  To: virtio-fs

From: Eric Ren <renzhen@linux.alibaba.com>

The daemon may bail out early on errors(e.g. in fuse_session_mount), where
it ends up a segfault error.

Signed-off-by: Eric Ren <renzhen@linux.alibaba.com>
---
 contrib/virtiofsd/fuse_virtio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/virtiofsd/fuse_virtio.c b/contrib/virtiofsd/fuse_virtio.c
index aa94b66..6292e87 100644
--- a/contrib/virtiofsd/fuse_virtio.c
+++ b/contrib/virtiofsd/fuse_virtio.c
@@ -891,6 +891,10 @@ int virtio_session_mount(struct fuse_session *se)
 void virtio_session_close(struct fuse_session *se)
 {
         close(se->vu_socketfd);
+
+        if (!se->virtio_dev)
+                return;
+
         free(se->virtio_dev->qi);
         free(se->virtio_dev);
         se->virtio_dev = NULL;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-05 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-03  5:28 [Virtio-fs] [PATCH] Virtiofsd: fix segfault when quit before dev init Liu Bo
2019-08-04  3:15 ` piaojun
2019-08-05 11:18 ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.