Whamcloud - gitweb
LU-6142 lnet: return proper error code
[fs/lustre-release.git] / lnet / lnet / api-ni.c
index 0302f67..dd7e96a 100644 (file)
@@ -1422,7 +1422,7 @@ int lnet_lib_init(void)
                CERROR("Can't have %d CPTs for LNet (max allowed is %d), "
                       "please change setting of CPT-table and retry\n",
                       the_lnet.ln_cpt_number, LNET_CPT_MAX);
-               return -1;
+               return -E2BIG;
        }
 
        while ((1 << the_lnet.ln_cpt_bits) < the_lnet.ln_cpt_number)
@@ -1431,7 +1431,7 @@ int lnet_lib_init(void)
        rc = lnet_create_locks();
        if (rc != 0) {
                CERROR("Can't create LNet global locks: %d\n", rc);
-               return -1;
+               return rc;
        }
 
        the_lnet.ln_refcount = 0;
@@ -1946,7 +1946,7 @@ LNetCtl(unsigned int cmd, void *arg)
                net_config = (struct lnet_ioctl_net_config *)
                        config->cfg_bulk;
                if (net_config == NULL)
-                       return -1;
+                       return -EINVAL;
 
                return lnet_get_net_config(config->cfg_count,
                                           &config->cfg_ncpts,