summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_target.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2019-08-09 05:01:38 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2019-08-13 03:34:05 +0200
commit8b21900b09a55ccee1aaddaabee729484f641997 (patch)
tree02e5d955c9097acc559183692a5c1d1cce787e4f /drivers/scsi/qla2xxx/qla_target.c
parentscsi: qla2xxx: Remove a superfluous pointer check (diff)
downloadlinux-8b21900b09a55ccee1aaddaabee729484f641997.tar.xz
linux-8b21900b09a55ccee1aaddaabee729484f641997.zip
scsi: qla2xxx: Remove two superfluous tests
Since qlt_remove_target() only calls qlt_release() if vha->vha_tgt.qla_tgt != NULL, checking that pointer inside qlt_release() is not necessary. This patch fixes the following Coverity complaint: CID 188348 (#1 of 1): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer &vha->vha_tgt.qla_tgt->tgt_list_entry to list_del, which dereferences it. Cc: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Himanshu Madhani <hmadhani@marvell.com> Reviewed-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_target.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 221912da67c6..12a3e77e0d02 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -1580,11 +1580,10 @@ static void qlt_release(struct qla_tgt *tgt)
struct qla_qpair_hint *h;
struct qla_hw_data *ha = vha->hw;
- if ((vha->vha_tgt.qla_tgt != NULL) && !tgt->tgt_stop &&
- !tgt->tgt_stopped)
+ if (!tgt->tgt_stop && !tgt->tgt_stopped)
qlt_stop_phase1(tgt);
- if ((vha->vha_tgt.qla_tgt != NULL) && !tgt->tgt_stopped)
+ if (!tgt->tgt_stopped)
qlt_stop_phase2(tgt);
for (i = 0; i < vha->hw->max_qpairs + 1; i++) {