mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
scsi: qla2xxx: Check entry_status in qla24xx_modify_vp_config()
The Modify VP Config completion handler labelled its first error branch
"error status" but tested vpmod->comp_status instead of
vpmod->entry_status. Because CS_COMPLETE is 0, the following
"comp_status != CS_COMPLETE" branch duplicated that test and was dead
code, and entry_status was never examined at all.
When firmware rejects the IOCB early it sets entry_status while leaving
comp_status zero. As the IOCB is allocated with dma_pool_zalloc(), both
comp_status branches evaluate false and the handler falls through to the
success path, calling fc_vport_set_state(FC_VPORT_INITIALIZING) for a
configuration the firmware never accepted. This can leave the virtual
port enabled on top of an invalid config and surface later as login
timeouts or follow-on firmware errors.
Test entry_status in the first branch, matching qla_ctrlvp_completed()
and the login/logout/abort/reset IOCB handlers; the comp_status branch
then becomes the live completion-status check.
Fixes: 2c3dfe3f6a ("[SCSI] qla2xxx: add support for NPIV")
Cc: stable@vger.kernel.org
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Link: https://patch.msgid.link/20260723050413.3897522-50-njavali@marvell.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
parent
878613ecb5
commit
9101c51649
|
|
@ -4401,10 +4401,10 @@ qla24xx_modify_vp_config(scsi_qla_host_t *vha)
|
|||
if (rval != QLA_SUCCESS) {
|
||||
ql_dbg(ql_dbg_mbx, vha, 0x10bd,
|
||||
"Failed to issue VP config IOCB (%x).\n", rval);
|
||||
} else if (vpmod->comp_status != 0) {
|
||||
} else if (vpmod->entry_status != 0) {
|
||||
ql_dbg(ql_dbg_mbx, vha, 0x10be,
|
||||
"Failed to complete IOCB -- error status (%x).\n",
|
||||
vpmod->comp_status);
|
||||
vpmod->entry_status);
|
||||
rval = QLA_FUNCTION_FAILED;
|
||||
} else if (vpmod->comp_status != cpu_to_le16(CS_COMPLETE)) {
|
||||
ql_dbg(ql_dbg_mbx, vha, 0x10bf,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user