From 6cbe580d897c0f1adc448dfd2ded9673ef420045 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 24 Apr 2014 18:43:41 +0000 Subject: [PATCH] ib_srpt: Unload properly with RDMA/CM disabled git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5474 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 86f5fcbd2..9608a4c4c 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -4378,7 +4378,8 @@ static void __exit srpt_cleanup_module(void) { TRACE_ENTRY(); - rdma_destroy_id(rdma_cm_id); + if (rdma_cm_id) + rdma_destroy_id(rdma_cm_id); ib_unregister_client(&srpt_client); #ifdef CONFIG_SCST_PROC srpt_unregister_procfs_entry(&srpt_template);