From nobody Wed Dec 24 03:32:21 2025 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5103A66B24 for ; Tue, 30 Jan 2024 09:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608193; cv=none; b=m7Wzl9M6GGYxZ09CqnXUyVWlsZtHkvgUUT2wsAQT92tj4h00ytbJKCHyx1NJRQi9+WfYiyxYOp47YQ5b9P9hOLB5thz/0LhTEK1JS5W/laM4upWg37Jxu4/FpQbHU61h1jpjsXBj/fVK4B/Uv0UdcImNgsdepinKogJYPuU8G0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608193; c=relaxed/simple; bh=Lbfj3Z0PTLwuhTwd7V4Bm9MgVroo+VvqDP8UxzsaoIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=izq6bCe7ssoFa3PcDNHkI+viJ31gt8SsTeDMIdnA0xNGb4rxkuedV196EPBMHOVHXxF/ZBL+GYrWk+vFa0d0n4WD1pifiRKOaYR5kfyq2QsXqsgGb1AxiDNqnsbpwmeyFDG90wJdtL8ICCXDbxaV4cAPYAk1+QMpw2prJb+feNg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C6C0F222DE; Tue, 30 Jan 2024 09:49:49 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id A7BE61376E; Tue, 30 Jan 2024 09:49:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id EcKBJz3GuGWJbwAAn2gu4w (envelope-from ); Tue, 30 Jan 2024 09:49:49 +0000 From: Daniel Wagner To: James Smart Cc: Keith Busch , Christoph Hellwig , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Daniel Wagner Subject: [PATCH v4 03/12] nvmet-fc: release reference on target port Date: Tue, 30 Jan 2024 10:49:29 +0100 Message-ID: <20240130094938.1575-4-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240130094938.1575-1-dwagner@suse.de> References: <20240130094938.1575-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: C6C0F222DE X-Spam-Flag: NO Content-Type: text/plain; charset="utf-8" In case we return early out of __nvmet_fc_finish_ls_req() we still have to release the reference on the target port. Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner Reviewed-by: Christoph Hellwig --- drivers/nvme/target/fc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 05e6a755b330..3d53d9dc1099 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -360,7 +360,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lso= p) =20 if (!lsop->req_queued) { spin_unlock_irqrestore(&tgtport->lock, flags); - return; + goto out_puttgtport; } =20 list_del(&lsop->lsreq_list); @@ -373,6 +373,7 @@ __nvmet_fc_finish_ls_req(struct nvmet_fc_ls_req_op *lso= p) (lsreq->rqstlen + lsreq->rsplen), DMA_BIDIRECTIONAL); =20 +out_puttgtport: nvmet_fc_tgtport_put(tgtport); } =20 --=20 2.43.0