Skip to content

Commit 70289ae

Browse files
igawChristoph Hellwig
authored andcommitted
nvmet-fc: put ref when assoc->del_work is already scheduled
Do not leak the tgtport reference when the work is already scheduled. Signed-off-by: Daniel Wagner <wagi@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent b0b26ad commit 70289ae

File tree

1 file changed

+2
-1
lines changed
  • drivers/nvme/target

1 file changed

+2
-1
lines changed

drivers/nvme/target/fc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,8 @@ static void
10731073
nvmet_fc_schedule_delete_assoc(struct nvmet_fc_tgt_assoc *assoc)
10741074
{
10751075
nvmet_fc_tgtport_get(assoc->tgtport);
1076-
queue_work(nvmet_wq, &assoc->del_work);
1076+
if (!queue_work(nvmet_wq, &assoc->del_work))
1077+
nvmet_fc_tgtport_put(assoc->tgtport);
10771078
}
10781079

10791080
static bool

0 commit comments

Comments
 (0)