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:
Craig Rodrigues 2005-12-08 04:27:53 +00:00
parent 8539ca4cde
commit d5989f64cf

View File

@ -1189,6 +1189,7 @@ static void
devfs_first(void)
{
struct thread *td = curthread;
struct vfsoptlist *opts;
struct vfsconf *vfsp;
struct mount *mp = NULL;
int error;
@ -1208,6 +1209,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);