Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 2024 12:53:04 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Alexander Leidinger <Alexander@leidinger.net>
Cc:        Current <current@freebsd.org>, Alexander Motin <mav@freebsd.org>
Subject:   Re: _mtx_lock_sleep: recursed on non-recursive mutex CAM device lock @ /..../sys/cam/nvme/nvme_da.c:469
Message-ID:  <CANCZdfo-k_ScVQY1MtOC2wUG4nCatbea9JwS7xzJc_OduVLyhA@mail.gmail.com>
In-Reply-To: <730565997ef678bbfe87d7861075edae@Leidinger.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]

[-- Attachment #2 --]
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 3f6cf8702870..357e612200e9 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -1077,7 +1077,9 @@ ndastart(struct cam_periph *periph, union ccb *start_ccb)
 
 			trim = malloc(sizeof(*trim), M_NVMEDA, M_ZERO | M_NOWAIT);
 			if (trim == NULL) {
+				cam_periph_unlock(periph);
 				biofinish(bp, NULL, ENOMEM);
+				cam_periph_lock(periph);
 				xpt_release_ccb(start_ccb);
 				ndaschedule(periph);
 				return;
help

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