scsi: qla2xxx: Return switch command on a timeout
authorHimanshu Madhani <himanshu.madhani@cavium.com>
Fri, 28 Sep 2018 18:02:38 +0000 (11:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Oct 2019 06:26:08 +0000 (08:26 +0200)
commit288831cba980cca8755675c9c3213ea703c1cf0f
tree139cabb45f4c6083e66f68b9f19e8397d99dc29c
parent2b983f212c68c6a1ed7e5c04023d9cf97aea9ae7
scsi: qla2xxx: Return switch command on a timeout

[ Upstream commit ef801f07e7b3cc1786d8ab1b4fdf069cc2a136d2 ]

This patch fixes commit bcc71cc3cde1 ("scsi: qla2xxx: Fix for double
free of SRB structure") which placed code in wrong routines.

Also updated the use of WARN_ON() to WARN_ON_ONCE() to prevent
flooding log messages.

Fixes: bcc71cc3cde1 ("scsi: qla2xxx: Fix for double free of SRB structure")
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla2xxx/qla_init.c