Print this page
10083 smatch fixes for common/fs/vfs.c

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/vfs.c
          +++ new/usr/src/uts/common/fs/vfs.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2016 Joyent, Inc.
       24 + * Copyright (c) 2018, Joyent, Inc.
  25   25   * Copyright 2016 Toomas Soome <tsoome@me.com>
  26   26   * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
  27   27   * Copyright 2016 Nexenta Systems, Inc.
  28   28   * Copyright 2017 RackTop Systems.
  29   29   */
  30   30  
  31   31  /*      Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
  32   32  /*        All Rights Reserved   */
  33   33  
  34   34  /*
↓ open down ↓ 1019 lines elided ↑ open up ↑
1054 1054          err = ldi_ioctl(ldi_hdl, LOFI_UNMAP_FILE_MINOR, (intptr_t)li,
1055 1055              FREAD | FWRITE | FKIOCTL, kcred, NULL);
1056 1056  
1057 1057          (void) ldi_close(ldi_hdl, FREAD | FWRITE, kcred);
1058 1058  
1059 1059          if (!err)
1060 1060                  vfsp->vfs_lofi_id = 0;
1061 1061  
1062 1062  out:
1063 1063          ldi_ident_release(ldi_id);
1064      -        if (li != NULL)
1065      -                kmem_free(li, sizeof (*li));
     1064 +        kmem_free(li, sizeof (*li));
1066 1065  }
1067 1066  
1068 1067  /*
1069 1068   * Common mount code.  Called from the system call entry point, from autofs,
1070 1069   * nfsv4 trigger mounts, and from pxfs.
1071 1070   *
1072 1071   * Takes the effective file system type, mount arguments, the mount point
1073 1072   * vnode, flags specifying whether the mount is a remount and whether it
1074 1073   * should be entered into the vfs list, and credentials.  Fills in its vfspp
1075 1074   * parameter with the mounted file system instance's vfs.
↓ open down ↓ 3149 lines elided ↑ open up ↑
4225 4224  
4226 4225          /*
4227 4226           * Call the init routines of non-loadable filesystems only.
4228 4227           * Filesystems which are loaded as separate modules will be
4229 4228           * initialized by the module loading code instead.
4230 4229           */
4231 4230  
4232 4231          for (vswp = &vfssw[1]; vswp < &vfssw[nfstype]; vswp++) {
4233 4232                  RLOCK_VFSSW();
4234 4233                  if (vswp->vsw_init != NULL)
4235      -                        (*vswp->vsw_init)(vswp - vfssw, vswp->vsw_name);
     4234 +                        (void) (*vswp->vsw_init)(vswp - vfssw, vswp->vsw_name);
4236 4235                  RUNLOCK_VFSSW();
4237 4236          }
4238 4237  
4239 4238          vopstats_startup();
4240 4239  
4241 4240          if (vopstats_enabled) {
4242 4241                  /* EIO_vfs can collect stats, but we don't retrieve them */
4243 4242                  initialize_vopstats(&EIO_vfs.vfs_vopstats);
4244 4243                  EIO_vfs.vfs_fstypevsp = NULL;
4245 4244                  EIO_vfs.vfs_vskap = NULL;
↓ open down ↓ 531 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX