summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-05-14 17:09:52 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-26 11:27:31 +0200
commit048440c0ba652251e7c4577ffa9a94e1b4a42830 (patch)
treea58a90bef6c477851d6406eb666a2d52a35b2934
parent52176a2d4d8d696cb671a40e2bf7e867a9c3a28d (diff)
downloadlinux-stable-048440c0ba652251e7c4577ffa9a94e1b4a42830.tar.gz
linux-stable-048440c0ba652251e7c4577ffa9a94e1b4a42830.tar.bz2
linux-stable-048440c0ba652251e7c4577ffa9a94e1b4a42830.zip
scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword()
[ Upstream commit 5cb289bf2d7c34ca1abd794ce116c4f19185a1d4 ] Fix to return a negative error code from the error handling case instead of 0 as done elsewhere in this function. Link: https://lore.kernel.org/r/20210514090952.6715-1-thunder.leizhen@huawei.com Fixes: a9083016a531 ("[SCSI] qla2xxx: Add ISP82XX support.") Reported-by: Hulk Robot <hulkci@huawei.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 65f8d2d94159..46f7e3988009 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -1103,7 +1103,8 @@ qla82xx_write_flash_dword(struct qla_hw_data *ha, uint32_t flashaddr,
return ret;
}
- if (qla82xx_flash_set_write_enable(ha))
+ ret = qla82xx_flash_set_write_enable(ha);
+ if (ret < 0)
goto done_write;
qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_WDATA, data);