diff mbox

[v2,rdma-core] srp_daemon: Remove duplicate sync_res shutdown

Message ID 20171219213800.GA28378@ziepe.ca (mailing list archive)
State Superseded
Headers show

Commit Message

Jason Gunthorpe Dec. 19, 2017, 9:38 p.m. UTC
The very first thing free_res does is the same lock/signal/unlock
sequence, so there is no reason to open code it before calling
free_res.

res->sync_res always exists at this point so remove the assert too.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 srp_daemon/srp_daemon.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

v2:
Remove the assert too

Comments

Bart Van Assche Dec. 19, 2017, 9:39 p.m. UTC | #1
On Tue, 2017-12-19 at 14:38 -0700, Jason Gunthorpe wrote:
> -		sync_resources_cleanup(res->sync_res);

> +	f	sync_resources_cleanup(res->sync_res);


This looks like an unintended change?

Bart.
diff mbox

Patch

diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index cec36db2e0f12e..696c58bfd0b1ec 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -1899,7 +1899,7 @@  static void free_res(struct resources *res)
 		pthread_join(res->trap_thread, &status);
 	}
 	if (res->sync_res)
-		sync_resources_cleanup(res->sync_res);
+	f	sync_resources_cleanup(res->sync_res);
 	if (res->ud_res)
 		ud_resources_destroy(res->ud_res);
 	if (res->umad_res)
@@ -2073,12 +2073,6 @@  static int ibsrpdm(int argc, char *argv[])
 	if (ret)
 		pr_err("Querying SRP targets failed\n");
 
-	assert(res->sync_res);
-	pthread_mutex_lock(&res->sync_res->retry_mutex);
-	res->sync_res->stop_threads = 1;
-	pthread_cond_signal(&res->sync_res->retry_cond);
-	pthread_mutex_unlock(&res->sync_res->retry_mutex);
-
 	free_res(res);
 umad_done:
 	umad_done();