Commit 50b474e1 authored by Daniel Wagner's avatar Daniel Wagner Committed by Keith Busch

nvmet-fc: remove null hostport pointer check

An association has always a valid hostport pointer. Remove useless
null pointer check.
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDaniel Wagner <dwagner@suse.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent ca121a0f
...@@ -488,8 +488,7 @@ nvmet_fc_xmt_disconnect_assoc(struct nvmet_fc_tgt_assoc *assoc) ...@@ -488,8 +488,7 @@ nvmet_fc_xmt_disconnect_assoc(struct nvmet_fc_tgt_assoc *assoc)
* message is normal. Otherwise, send unless the hostport has * message is normal. Otherwise, send unless the hostport has
* already been invalidated by the lldd. * already been invalidated by the lldd.
*/ */
if (!tgtport->ops->ls_req || !assoc->hostport || if (!tgtport->ops->ls_req || assoc->hostport->invalid)
assoc->hostport->invalid)
return; return;
lsop = kzalloc((sizeof(*lsop) + lsop = kzalloc((sizeof(*lsop) +
...@@ -1524,8 +1523,7 @@ nvmet_fc_invalidate_host(struct nvmet_fc_target_port *target_port, ...@@ -1524,8 +1523,7 @@ nvmet_fc_invalidate_host(struct nvmet_fc_target_port *target_port,
spin_lock_irqsave(&tgtport->lock, flags); spin_lock_irqsave(&tgtport->lock, flags);
list_for_each_entry_safe(assoc, next, list_for_each_entry_safe(assoc, next,
&tgtport->assoc_list, a_list) { &tgtport->assoc_list, a_list) {
if (!assoc->hostport || if (assoc->hostport->hosthandle != hosthandle)
assoc->hostport->hosthandle != hosthandle)
continue; continue;
if (!nvmet_fc_tgt_a_get(assoc)) if (!nvmet_fc_tgt_a_get(assoc))
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment