From 3d52cdeb532953264e347333ec3c8c7422228632 Mon Sep 17 00:00:00 2001 From: dyoung Date: Fri, 30 Sep 2005 08:15:46 +0000 Subject: [PATCH] In cd9660_mount, initialize imp to VFSTOISOFS(mp) instead of NULL. Remove redundant assignments to imp. This fixes the page fault panic when the kernel mounts an ISO9660 filesystem, introduced at revision 1.27. --- sys/fs/cd9660/cd9660_vfsops.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 1c22001c3550..4ad42bfaa8f2 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.27 2005/09/23 12:10:32 jmmv Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.28 2005/09/30 08:15:46 dyoung Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.27 2005/09/23 12:10:32 jmmv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.28 2005/09/30 08:15:46 dyoung Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -169,10 +169,9 @@ cd9660_mount(mp, path, data, ndp, p) struct vnode *devvp; struct iso_args args; int error; - struct iso_mnt *imp = NULL; + struct iso_mnt *imp = VFSTOISOFS(mp); if (mp->mnt_flag & MNT_GETARGS) { - imp = VFSTOISOFS(mp); if (imp == NULL) return EIO; args.fspec = NULL; @@ -248,7 +247,6 @@ cd9660_mount(mp, path, data, ndp, p) if (devvp != imp->im_devvp) return (EINVAL); /* needs translation */ } - imp = VFSTOISOFS(mp); return set_statvfs_info(path, UIO_USERSPACE, args.fspec, UIO_USERSPACE, mp, p);