Skip to contentSkip to conversation

IB/core: fix an error code in ib_core_init()

PATCH Applied Dan Carpenter 3 participants 3 messages May 31, 2016 – Jun 6, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/core: fix an error code in ib_core_init()

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')
drivers/infiniband/core/device.c +2 -1
index 5516fb0..8b8a8d9 100644
@@ -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;
 	}
Reviewed-by on v1 1/1
#1 lore raw

Nice catch, looks good.

Quoted 37 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Tuesday, May 31, 2016 7:06 PM
To: Doug Ledford <[email protected]>; Mark Bloch <[email protected]>
Cc: Sean Hefty <[email protected]>; Hal Rosenstock <[email protected]>; Matan Barak <[email protected]>; Or Gerlitz <[email protected]>; Ira Weiny <[email protected]>; Haggai Eran <[email protected]>; Leon Romanovsky <[email protected]>; Jason Gunthorpe <[email protected]>; Yotam Kenneth (revoke on 13.10.15) <[email protected]>; Parav Pandit <[email protected]>; linux- [email protected]; [email protected]
Subject: [patch] IB/core: fix an error code in ib_core_init()

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')

drivers/infiniband/core/device.c +2 -1
index 5516fb0..8b8a8d9 100644
@@ -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;
 	}
Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 12 lines · Dan Carpenter

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')
drivers/infiniband/core/device.c +0 -0
index 5516fb0..8b8a8d9 100644

drivers/infiniband/core/device.c static int __init ib_core_init(void) · line 1031

Quoted 9 lines
drivers/infiniband/core/device.c +2 -1
@@ -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;
 	}

Thanks, applied.