Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Feb 2015 07:16:45 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r278233 - head/sys/dev/iscsi
Message-ID:  <201502050716.t157Gjf9047806@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu Feb  5 07:16:45 2015
New Revision: 278233
URL: https://svnweb.freebsd.org/changeset/base/278233

Log:
  Fix error handling.
  
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Thu Feb  5 06:37:59 2015	(r278232)
+++ head/sys/dev/iscsi/iscsi.c	Thu Feb  5 07:16:45 2015	(r278233)
@@ -1766,15 +1766,17 @@ iscsi_ioctl_session_add(struct iscsi_sof
 	arc4rand(&is->is_isid[1], 5, 0);
 	is->is_tsih = 0;
 	callout_init(&is->is_callout, 1);
-	callout_reset(&is->is_callout, 1 * hz, iscsi_callout, is);
-	TAILQ_INSERT_TAIL(&sc->sc_sessions, is, is_next);
 
 	error = kthread_add(iscsi_maintenance_thread, is, NULL, NULL, 0, 0, "iscsimt");
 	if (error != 0) {
 		ISCSI_SESSION_WARN(is, "kthread_add(9) failed with error %d", error);
+		sx_xunlock(&sc->sc_lock);
 		return (error);
 	}
 
+	callout_reset(&is->is_callout, 1 * hz, iscsi_callout, is);
+	TAILQ_INSERT_TAIL(&sc->sc_sessions, is, is_next);
+
 	/*
 	 * Trigger immediate reconnection.
 	 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502050716.t157Gjf9047806>