IB/core: fix an error code in ib_core_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 31 May 2016 16:05:56 +0000 (19:05 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 6 Jun 2016 23:19:07 +0000 (19:19 -0400)
We should return the error code if ib_add_ibnl_clients() fails.  The
current code returns success.

Fixes: 735c631ae99d ('IB/core: Register SA ibnl client during ib_core initialization')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/device.c

index 5516fb0703442cafc0c917d3115b8b25e7c71b27..8b8a8d9cf13448049de37914305a78d2d451e0d6 100644 (file)
@@ -1024,7 +1024,8 @@ static int __init ib_core_init(void)
                goto err_mad;
        }
 
-       if (ib_add_ibnl_clients()) {
+       ret = ib_add_ibnl_clients();
+       if (ret) {
                pr_warn("Couldn't register ibnl clients\n");
                goto err_sa;
        }