MFC: 1.208

In devfs_first(), set mp->mnt_opt to a valid empty list of mount options
instead of leaving it NULL.  This eliminates a kernel panic
when trying to do a mount -o update of /dev.

Noticed by:	cjsp
Reviewed by:	phk
This commit is contained in:
rodrigc 2006-05-28 18:44:47 +00:00
parent cb88adac76
commit 6cfcaeedd1

View File

@ -1245,6 +1245,7 @@ static void
devfs_first(void)
{
struct thread *td = curthread;
struct vfsoptlist *opts;
struct vfsconf *vfsp;
struct mount *mp = NULL;
int error;
@ -1264,6 +1265,10 @@ devfs_first(void)
if (error)
return;
opts = malloc(sizeof(struct vfsoptlist), M_MOUNT, M_WAITOK);
TAILQ_INIT(opts);
mp->mnt_opt = opts;
mtx_lock(&mountlist_mtx);
TAILQ_INSERT_HEAD(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);