[PATCH 3/3] Fix segfault on exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If iser_ib_init fails (due to no RDMA-capable hw, which is ok) and
iser_send_nop is 1, then tgtd will segfault on exit, trying to remove
the work item that was never initialized or added.

See https://bugzilla.redhat.com/show_bug.cgi?id=712807 for more info.

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 usr/iscsi/iser.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/usr/iscsi/iser.c b/usr/iscsi/iser.c
index a582bdf..7c263f5 100644
--- a/usr/iscsi/iser.c
+++ b/usr/iscsi/iser.c
@@ -3336,8 +3336,10 @@ static int iser_init(int index, char *args)
 	int err;
 
 	err = iser_ib_init();
-	if (err)
+	if (err) {
+		iser_send_nop = 0;
 		return err;
+	}
 
 	if (iser_send_nop) {
 		nop_work.func = iser_nop_work_handler;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux