check ip before dereferencing (can only happen when called to mount root)
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Mon, 4 May 1987 09:07:25 +0000 (01:07 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Mon, 4 May 1987 09:07:25 +0000 (01:07 -0800)
SCCS-vsn: sys/ufs/ffs/ffs_vfsops.c 7.4
SCCS-vsn: sys/ufs/ffs/ufs_vfsops.c 7.4
SCCS-vsn: sys/ufs/lfs/lfs_vfsops.c 7.4
SCCS-vsn: sys/ufs/ufs/ufs_vfsops.c 7.4

usr/src/sys/ufs/ffs/ffs_vfsops.c
usr/src/sys/ufs/ffs/ufs_vfsops.c
usr/src/sys/ufs/lfs/lfs_vfsops.c
usr/src/sys/ufs/ufs/ufs_vfsops.c

index e6f3cdf..c6e043b 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ffs_vfsops.c        7.3 (Berkeley) %G%
+ *     @(#)ffs_vfsops.c        7.4 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -222,7 +222,7 @@ found:
 out:
        if (error == 0)
                error = EIO;
 out:
        if (error == 0)
                error = EIO;
-       if (needclose)
+       if (needclose && ip)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
index 745f9b9..c9b4003 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ufs_vfsops.c        7.3 (Berkeley) %G%
+ *     @(#)ufs_vfsops.c        7.4 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -222,7 +222,7 @@ found:
 out:
        if (error == 0)
                error = EIO;
 out:
        if (error == 0)
                error = EIO;
-       if (needclose)
+       if (needclose && ip)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
index bbdd699..7111b02 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)lfs_vfsops.c        7.3 (Berkeley) %G%
+ *     @(#)lfs_vfsops.c        7.4 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -222,7 +222,7 @@ found:
 out:
        if (error == 0)
                error = EIO;
 out:
        if (error == 0)
                error = EIO;
-       if (needclose)
+       if (needclose && ip)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
index 745f9b9..c9b4003 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ufs_vfsops.c        7.3 (Berkeley) %G%
+ *     @(#)ufs_vfsops.c        7.4 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -222,7 +222,7 @@ found:
 out:
        if (error == 0)
                error = EIO;
 out:
        if (error == 0)
                error = EIO;
-       if (needclose)
+       if (needclose && ip)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)
                (void) closei((dev_t)ip->i_rdev, IFBLK,
                    ronly? FREAD : FREAD|FWRITE);
        if (needclose)