mwifiex: minor corrections in multiport aggregation code
authorXinming Hu <huxm@marvell.com>
Fri, 18 Sep 2015 13:32:05 +0000 (06:32 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 29 Sep 2015 07:47:30 +0000 (10:47 +0300)
This patch includes below changes
1) Check if multiport aggregation feature flag while doing rx
length validation check.
2) Reset buffer size variables when buffers are freed.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/sdio.c

index 5d05c6fe642985cd377eefec707d75112f0240ea..d35210caa94b3a97f3346f7fa91cf324c71abf86 100644 (file)
@@ -1606,8 +1606,9 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
                                (rx_len + MWIFIEX_SDIO_BLOCK_SIZE -
                                 1) / MWIFIEX_SDIO_BLOCK_SIZE;
                        if (rx_len <= INTF_HEADER_LEN ||
-                           (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE) >
-                            card->mpa_rx.buf_size) {
+                           (card->mpa_rx.enabled &&
+                            ((rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE) >
+                             card->mpa_rx.buf_size))) {
                                mwifiex_dbg(adapter, ERROR,
                                            "invalid rx_len=%d\n",
                                            rx_len);
@@ -1925,6 +1926,8 @@ error:
        if (ret) {
                kfree(card->mpa_tx.buf);
                kfree(card->mpa_rx.buf);
+               card->mpa_tx.buf_size = 0;
+               card->mpa_rx.buf_size = 0;
        }
 
        return ret;