]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword()
authorZhen Lei <thunder.leizhen@huawei.com>
Fri, 14 May 2021 09:09:52 +0000 (17:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 May 2021 09:27:31 +0000 (11:27 +0200)
[ 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>
drivers/scsi/qla2xxx/qla_nx.c

index 65f8d2d9415925ce2b30e5070550dac401b322d1..46f7e3988009e05fe550de5887399cec8d52d5d8 100644 (file)
@@ -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);