If LNetNIInit() fails, we'll get zero ln_refcount. So fail
LNetGetId() properly instead of asserting.
We can get to it when socklnd fails to scan network interfaces,
which is possible if Lustre is builtin.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        int             rc = -ENOENT;
 
        LASSERT(the_lnet.ln_init);
-       LASSERT(the_lnet.ln_refcount > 0);
+
+       /* LNetNI initilization failed? */
+       if (the_lnet.ln_refcount == 0)
+               return rc;
 
        cpt = lnet_net_lock_current();