[BACK]Return to kern_module.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/kern_module.c between version 1.117 and 1.118

version 1.117, 2016/08/13 12:05:49 version 1.118, 2016/12/09 13:06:41
Line 570  int
Line 570  int
 module_load(const char *filename, int flags, prop_dictionary_t props,  module_load(const char *filename, int flags, prop_dictionary_t props,
             modclass_t modclass)              modclass_t modclass)
 {  {
           module_t *mod;
         int error;          int error;
   
           /* Test if we already have the module loaded before
            * authorizing so we have the opportunity to return EEXIST. */
           kernconfig_lock();
           mod = module_lookup(filename);
           if (mod != NULL) {
                   module_print("%s module `%s' already loaded",
                       "requested", filename);
                   error = EEXIST;
                   goto out;
           }
   
         /* Authorize. */          /* Authorize. */
         error = kauth_authorize_system(kauth_cred_get(), KAUTH_SYSTEM_MODULE,          error = kauth_authorize_system(kauth_cred_get(), KAUTH_SYSTEM_MODULE,
             0, (void *)(uintptr_t)MODCTL_LOAD, NULL, NULL);              0, (void *)(uintptr_t)MODCTL_LOAD, NULL, NULL);
         if (error != 0) {          if (error != 0)
                 return error;                  goto out;
         }  
   
         kernconfig_lock();  
         error = module_do_load(filename, false, flags, props, NULL, modclass,          error = module_do_load(filename, false, flags, props, NULL, modclass,
             false);              false);
         kernconfig_unlock();  
   
   out:
           kernconfig_unlock();
         return error;          return error;
 }  }
   

Legend:
Removed from v.1.117  
changed lines
  Added in v.1.118

CVSweb <webmaster@jp.NetBSD.org>