linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Alexandr Sapozhnkiov <alsp705@gmail.com>
To: James Smart <james.smart@broadcom.com>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Alexandr Sapozhnikov <alsp705@gmail.com>, lvc-project@linuxtesting.org
Subject: [PATCH] nvme: target: fix error checking in nvmet_fc_schedule_delete_assoc()
Date: Thu,  2 Oct 2025 12:22:01 +0300	[thread overview]
Message-ID: <20251002092202.11-1-alsp705@gmail.com> (raw)

From: Alexandr Sapozhnikov <alsp705@gmail.com>

The nvmet_fc_tgtport_get() function may return an error.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Alexandr Sapozhnikov <alsp705@gmail.com>
---
 drivers/nvme/target/fc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index 337ee1cb09ae..68a416a92bfc 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1110,8 +1110,8 @@ nvmet_fc_delete_assoc_work(struct work_struct *work)
 static void
 nvmet_fc_schedule_delete_assoc(struct nvmet_fc_tgt_assoc *assoc)
 {
-	nvmet_fc_tgtport_get(assoc->tgtport);
-	queue_work(nvmet_wq, &assoc->del_work);
+	if (nvmet_fc_tgtport_get(assoc->tgtport))
+		queue_work(nvmet_wq, &assoc->del_work);
 }
 
 static bool
-- 
2.43.0



             reply	other threads:[~2025-10-02  9:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02  9:22 Alexandr Sapozhnkiov [this message]
2025-10-03 10:13 ` [PATCH] nvme: target: fix error checking in nvmet_fc_schedule_delete_assoc() Christoph Hellwig
2025-10-06 12:44   ` Daniel Wagner
2025-10-03 13:25 ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251002092202.11-1-alsp705@gmail.com \
    --to=alsp705@gmail.com \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).