diff options
author | himanshu.madhani@cavium.com <himanshu.madhani@cavium.com> | 2018-01-15 23:46:48 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-01-17 01:34:24 -0500 |
commit | 7ac0c332f96bb9688560726f5e80c097ed8de59a (patch) | |
tree | e84cba835f0e67de16a60f70ae45d6d44ef6add5 /drivers/scsi | |
parent | 3efc31f76dd7fc8a71cd86683909f637e9b7cadb (diff) |
scsi: qla2xxx: Fix warning in qla2x00_async_iocb_timeout()
This patch fixes following Smatch warning:
drivers/scsi/qla2xxx/qla_init.c:130 qla2x00_async_iocb_timeout() error: we previously assumed 'fcport' could be null (see line 107)
Fixes: 5c25d451163c ("scsi: qla2xxx: Fix NULL pointer access for fcport structure")
Reported by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 9c08222e4c8b..08ad1a60cb0d 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -117,6 +117,8 @@ qla2x00_async_iocb_timeout(void *data) | |||
117 | 117 | ||
118 | switch (sp->type) { | 118 | switch (sp->type) { |
119 | case SRB_LOGIN_CMD: | 119 | case SRB_LOGIN_CMD: |
120 | if (!fcport) | ||
121 | break; | ||
120 | /* Retry as needed. */ | 122 | /* Retry as needed. */ |
121 | lio->u.logio.data[0] = MBS_COMMAND_ERROR; | 123 | lio->u.logio.data[0] = MBS_COMMAND_ERROR; |
122 | lio->u.logio.data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? | 124 | lio->u.logio.data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? |
@@ -130,6 +132,8 @@ qla2x00_async_iocb_timeout(void *data) | |||
130 | qla24xx_handle_plogi_done_event(fcport->vha, &ea); | 132 | qla24xx_handle_plogi_done_event(fcport->vha, &ea); |
131 | break; | 133 | break; |
132 | case SRB_LOGOUT_CMD: | 134 | case SRB_LOGOUT_CMD: |
135 | if (!fcport) | ||
136 | break; | ||
133 | qlt_logo_completion_handler(fcport, QLA_FUNCTION_TIMEOUT); | 137 | qlt_logo_completion_handler(fcport, QLA_FUNCTION_TIMEOUT); |
134 | break; | 138 | break; |
135 | case SRB_CT_PTHRU_CMD: | 139 | case SRB_CT_PTHRU_CMD: |