diff options
author | trasz <trasz@FreeBSD.org> | 2015-05-15 10:47:25 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-05-15 10:47:25 +0000 |
commit | c22dbda4c6571ca2cc6ccfedb9b46363377a9f62 (patch) | |
tree | c96e9e84bd3f0b6fb565df643897f9c2d505fa42 /sys | |
parent | 7fcf215ed50ad2ca01604585e13972f046847976 (diff) | |
download | FreeBSD-src-c22dbda4c6571ca2cc6ccfedb9b46363377a9f62.zip FreeBSD-src-c22dbda4c6571ca2cc6ccfedb9b46363377a9f62.tar.gz |
MFC r278233:
Fix error handling.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/iscsi/iscsi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index e4f736c..a385d1c 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1754,15 +1754,17 @@ iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa) 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. */ |