Skip to content

Commit

Permalink
nvmet-fc: remove null hostport pointer check
Browse files Browse the repository at this point in the history
An association has always a valid hostport pointer. Remove useless
null pointer check.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
  • Loading branch information
Daniel Wagner authored and Keith Busch committed Feb 1, 2024
1 parent ca121a0 commit 50b474e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/nvme/target/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ nvmet_fc_xmt_disconnect_assoc(struct nvmet_fc_tgt_assoc *assoc)
* message is normal. Otherwise, send unless the hostport has
* already been invalidated by the lldd.
*/
if (!tgtport->ops->ls_req || !assoc->hostport ||
assoc->hostport->invalid)
if (!tgtport->ops->ls_req || assoc->hostport->invalid)
return;

lsop = kzalloc((sizeof(*lsop) +
Expand Down Expand Up @@ -1524,8 +1523,7 @@ nvmet_fc_invalidate_host(struct nvmet_fc_target_port *target_port,
spin_lock_irqsave(&tgtport->lock, flags);
list_for_each_entry_safe(assoc, next,
&tgtport->assoc_list, a_list) {
if (!assoc->hostport ||
assoc->hostport->hosthandle != hosthandle)
if (assoc->hostport->hosthandle != hosthandle)
continue;
if (!nvmet_fc_tgt_a_get(assoc))
continue;
Expand Down

0 comments on commit 50b474e

Please sign in to comment.