Skip to content

Commit 50b474e

Browse files
igawkeithbusch
authored andcommitted
nvmet-fc: remove null hostport pointer check
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>
1 parent ca121a0 commit 50b474e

File tree

1 file changed

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

1 file changed

+2
-4
lines changed

drivers/nvme/target/fc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,7 @@ nvmet_fc_xmt_disconnect_assoc(struct nvmet_fc_tgt_assoc *assoc)
488488
* message is normal. Otherwise, send unless the hostport has
489489
* already been invalidated by the lldd.
490490
*/
491-
if (!tgtport->ops->ls_req || !assoc->hostport ||
492-
assoc->hostport->invalid)
491+
if (!tgtport->ops->ls_req || assoc->hostport->invalid)
493492
return;
494493

495494
lsop = kzalloc((sizeof(*lsop) +
@@ -1524,8 +1523,7 @@ nvmet_fc_invalidate_host(struct nvmet_fc_target_port *target_port,
15241523
spin_lock_irqsave(&tgtport->lock, flags);
15251524
list_for_each_entry_safe(assoc, next,
15261525
&tgtport->assoc_list, a_list) {
1527-
if (!assoc->hostport ||
1528-
assoc->hostport->hosthandle != hosthandle)
1526+
if (assoc->hostport->hosthandle != hosthandle)
15291527
continue;
15301528
if (!nvmet_fc_tgt_a_get(assoc))
15311529
continue;

0 commit comments

Comments
 (0)