Author: asomers
Date: Sat Apr  6 18:04:04 2019
New Revision: 345986
URL: https://svnweb.freebsd.org/changeset/base/345986

Log:
  fusefs: fix a panic on mount
  
  Don't page fault if the file descriptor provided with "-o fd" is invalid.
  This is a merge of r345419 from the projects/fuse2 branch.
  
  Reviewed by:  ngie
  Tested by:    Marek Zarychta <zarych...@plan-b.pwste.edu.pl>
  MFC after:    2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D19836

Modified:
  head/sys/fs/fuse/fuse_vfsops.c

Modified: head/sys/fs/fuse/fuse_vfsops.c
==============================================================================
--- head/sys/fs/fuse/fuse_vfsops.c      Sat Apr  6 17:21:05 2019        
(r345985)
+++ head/sys/fs/fuse/fuse_vfsops.c      Sat Apr  6 18:04:04 2019        
(r345986)
@@ -225,7 +225,7 @@ fuse_vfsop_mount(struct mount *mp)
        size_t len;
 
        struct cdev *fdev;
-       struct fuse_data *data;
+       struct fuse_data *data = NULL;
        struct thread *td;
        struct file *fp, *fptmp;
        char *fspec, *subtype;
@@ -361,7 +361,7 @@ fuse_vfsop_mount(struct mount *mp)
 out:
        if (err) {
                FUSE_LOCK();
-               if (data->mp == mp) {
+               if (data != NULL && data->mp == mp) {
                        /*
                         * Destroy device only if we acquired reference to
                         * it
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to