git: 192c87bf7d64 - stable/13 - iscsi: Fix missing is_lock unlock after cam_simq_alloc() failed

From: Ka Ho Ng <khng_at_FreeBSD.org>
Date: Tue, 25 Jan 2022 06:03:05 UTC
The branch stable/13 has been updated by khng:

URL: https://cgit.FreeBSD.org/src/commit/?id=192c87bf7d64a1e3773ff33185e3430810992825

commit 192c87bf7d64a1e3773ff33185e3430810992825
Author:     Ka Ho Ng <khng@FreeBSD.org>
AuthorDate: 2022-01-21 21:34:15 +0000
Commit:     Ka Ho Ng <khng@FreeBSD.org>
CommitDate: 2022-01-25 06:02:33 +0000

    iscsi: Fix missing is_lock unlock after cam_simq_alloc() failed
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit fa669505340d54e401917aa6a3d7defb9fc203da)
---
 sys/dev/iscsi/iscsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index cc860e3f68a8..ff3203039d5f 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -1540,6 +1540,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc,
 		ISCSI_SESSION_LOCK(is);
 		is->is_devq = cam_simq_alloc(ic->ic_maxtags);
 		if (is->is_devq == NULL) {
+			ISCSI_SESSION_UNLOCK(is);
 			ISCSI_SESSION_WARN(is, "failed to allocate simq");
 			iscsi_session_terminate(is);
 			return (ENOMEM);