Commit 24716876 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville

mwifiex: error path handling in pcie firmware dump

This patch takes care of missing error paths in firmware dump.
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 34ed780a
...@@ -2243,8 +2243,8 @@ mwifiex_pcie_rdwr_firmware(struct mwifiex_adapter *adapter, u8 doneflag) ...@@ -2243,8 +2243,8 @@ mwifiex_pcie_rdwr_firmware(struct mwifiex_adapter *adapter, u8 doneflag)
if (ctrl_data != FW_DUMP_HOST_READY) { if (ctrl_data != FW_DUMP_HOST_READY) {
dev_info(adapter->dev, dev_info(adapter->dev,
"The ctrl reg was changed, re-try again!\n"); "The ctrl reg was changed, re-try again!\n");
mwifiex_write_reg(adapter, reg->fw_dump_ctrl, ret = mwifiex_write_reg(adapter, reg->fw_dump_ctrl,
FW_DUMP_HOST_READY); FW_DUMP_HOST_READY);
if (ret) { if (ret) {
dev_err(adapter->dev, "PCIE write err\n"); dev_err(adapter->dev, "PCIE write err\n");
return RDWR_STATUS_FAILURE; return RDWR_STATUS_FAILURE;
...@@ -2266,6 +2266,7 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter) ...@@ -2266,6 +2266,7 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
u8 *dbg_ptr, *end_ptr, dump_num, idx, i, read_reg, doneflag = 0; u8 *dbg_ptr, *end_ptr, dump_num, idx, i, read_reg, doneflag = 0;
enum rdwr_status stat; enum rdwr_status stat;
u32 memory_size; u32 memory_size;
int ret;
static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL }; static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
if (!card->pcie.supports_fw_dump) if (!card->pcie.supports_fw_dump)
...@@ -2337,11 +2338,13 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter) ...@@ -2337,11 +2338,13 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
reg_end = creg->fw_dump_end; reg_end = creg->fw_dump_end;
for (reg = reg_start; reg <= reg_end; reg++) { for (reg = reg_start; reg <= reg_end; reg++) {
mwifiex_read_reg_byte(adapter, reg, dbg_ptr); mwifiex_read_reg_byte(adapter, reg, dbg_ptr);
if (dbg_ptr < end_ptr) if (dbg_ptr < end_ptr) {
dbg_ptr++; dbg_ptr++;
else } else {
dev_err(adapter->dev, dev_err(adapter->dev,
"Allocated buf not enough\n"); "Allocated buf not enough\n");
goto done;
}
} }
if (stat != RDWR_STATUS_DONE) if (stat != RDWR_STATUS_DONE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment