fusefs: fix a panic on mount

Don't page fault if the file descriptor provided with "-o fd" is invalid.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Alan Somers 2019-03-22 17:53:13 +00:00
parent 6248288e97
commit 8ba190efeb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/fuse2/; revision=345419

View File

@ -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 && data->mp == mp) {
/*
* Destroy device only if we acquired reference to
* it