summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/pcie.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-09-18 08:04:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-09-30 13:17:13 -0400
commit24716876d82ac0cb7ade51b7363ebc125307e9cc (patch)
treed3d0b9539612f5c8db903f68e8df3006d5f12060 /drivers/net/wireless/mwifiex/pcie.c
parent34ed780a6afc4df5e3285d20fac721c591e0724e (diff)
downloadblackbird-op-linux-24716876d82ac0cb7ade51b7363ebc125307e9cc.tar.gz
blackbird-op-linux-24716876d82ac0cb7ade51b7363ebc125307e9cc.zip
mwifiex: error path handling in pcie firmware dump
This patch takes care of missing error paths in firmware dump. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/pcie.c')
-rw-r--r--drivers/net/wireless/mwifiex/pcie.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 1504b16e248e..803b8304b144 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -2243,8 +2243,8 @@ mwifiex_pcie_rdwr_firmware(struct mwifiex_adapter *adapter, u8 doneflag)
if (ctrl_data != FW_DUMP_HOST_READY) {
dev_info(adapter->dev,
"The ctrl reg was changed, re-try again!\n");
- mwifiex_write_reg(adapter, reg->fw_dump_ctrl,
- FW_DUMP_HOST_READY);
+ ret = mwifiex_write_reg(adapter, reg->fw_dump_ctrl,
+ FW_DUMP_HOST_READY);
if (ret) {
dev_err(adapter->dev, "PCIE write err\n");
return RDWR_STATUS_FAILURE;
@@ -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;
enum rdwr_status stat;
u32 memory_size;
+ int ret;
static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
if (!card->pcie.supports_fw_dump)
@@ -2337,11 +2338,13 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
reg_end = creg->fw_dump_end;
for (reg = reg_start; reg <= reg_end; reg++) {
mwifiex_read_reg_byte(adapter, reg, dbg_ptr);
- if (dbg_ptr < end_ptr)
+ if (dbg_ptr < end_ptr) {
dbg_ptr++;
- else
+ } else {
dev_err(adapter->dev,
"Allocated buf not enough\n");
+ goto done;
+ }
}
if (stat != RDWR_STATUS_DONE)
OpenPOWER on IntegriCloud