OSDN Git Service

nvmet-fc: check successful reference in nvmet_fc_find_target_assoc
authorJames Smart <jsmart2021@gmail.com>
Fri, 24 Jul 2020 16:40:00 +0000 (09:40 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 29 Jul 2020 05:45:20 +0000 (07:45 +0200)
commit34efa23234c8b55dd178bba2216ca9ae9b50e1c9
tree5acd7696d553e6e96cfb6696320793914a1ef913
parent237480760c5050e8e897846b93ba9ffdb6444301
nvmet-fc: check successful reference in nvmet_fc_find_target_assoc

When searching for an association based on an association id, when there
is a match, the code takes a reference. However, it is not validating
that the reference taking was successful.

Check the status of the reference. If unsuccessful, the device is being
deleted and should be ignored.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fc.c