[lvc-project] [PATCH] nvme: target: fix error checking in nvmet_fc_schedule_delete_assoc()

Christoph Hellwig hch at lst.de
Fri Oct 3 13:13:54 MSK 2025


Adding Daniel who has been touching this area recently.

On Thu, Oct 02, 2025 at 12:22:01PM +0300, Alexandr Sapozhnkiov wrote:
> From: Alexandr Sapozhnikov <alsp705 at 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 at 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
---end quoted text---



More information about the lvc-project mailing list