scsi: qla2xxx: Fix race condition between iocb timeout and initialisation
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Tue, 20 Mar 2018 21:36:14 +0000 (21:36 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 10 Apr 2018 01:04:36 +0000 (21:04 -0400)
commite74e7d95878d7993cf56c801d55d78f16ea58d1d
tree67ee854ff12dd8a2f4d6b24c84312902fa86ea4d
parent3a9910d7b686546dcc9986e790af17e148f1c888
scsi: qla2xxx: Fix race condition between iocb timeout and initialisation

qla2x00_init_timer() calls add_timer() on the iocb timeout timer, which
means the timeout function pointer and any data that the function depends on
must be initialised beforehand.

Move this initialisation before each call to qla2x00_init_timer().  In some
cases qla2x00_init_timer() initialises a completion structure needed by the
timeout function, so move the call to add_timer() after that.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_inline.h
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_mid.c
drivers/scsi/qla2xxx/qla_mr.c
drivers/scsi/qla2xxx/qla_target.c