X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fklnds%2Fo2iblnd%2Fo2iblnd.c;h=432c450d016c7af10117378a34f3d3bac8603af8;hp=11a39f5521b63023aa9461a549d6857e0e9857f5;hb=99f85541a685df82265f18167e91c161c523ce50;hpb=fcf219db6d2cfb692f0b987945e85953a5b07de7;ds=sidebyside diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 11a39f5..432c450 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -3192,10 +3192,10 @@ static int kiblnd_dev_start_threads(struct kib_dev *dev, u32 *cpts, int ncpts) static int kiblnd_startup(struct lnet_ni *ni) { - char *ifname; + char *ifname = NULL; struct lnet_inetdev *ifaces = NULL; struct kib_dev *ibdev = NULL; - struct kib_net *net; + struct kib_net *net = NULL; unsigned long flags; int rc; int i; @@ -3210,8 +3210,10 @@ kiblnd_startup(struct lnet_ni *ni) LIBCFS_ALLOC(net, sizeof(*net)); ni->ni_data = net; - if (net == NULL) + if (net == NULL) { + rc = -ENOMEM; goto failed; + } net->ibn_incarnation = ktime_get_real_ns() / NSEC_PER_USEC; @@ -3226,6 +3228,7 @@ kiblnd_startup(struct lnet_ni *ni) /* Use the IPoIB interface specified in 'networks=' */ if (ni->ni_interfaces[1] != NULL) { CERROR("ko2iblnd: Multiple interfaces not supported\n"); + rc = -EINVAL; goto failed; } @@ -3236,6 +3239,7 @@ kiblnd_startup(struct lnet_ni *ni) if (strlen(ifname) >= sizeof(ibdev->ibd_ifname)) { CERROR("IPoIB interface name too long: %s\n", ifname); + rc = -E2BIG; goto failed; } @@ -3309,7 +3313,9 @@ failed: kfree(ifaces); kiblnd_shutdown(ni); - CDEBUG(D_NET, "kiblnd_startup failed\n"); + CDEBUG(D_NET, "Configuration of device %s failed: rc = %d\n", + ifname ? ifname : "", rc); + return -ENETDOWN; }