diff options
author | Avinash Patil <patila@marvell.com> | 2011-12-08 23:41:04 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:33:23 -0500 |
commit | 17a60b48193f32ab0c87e0d57df6ab408fbe9bca (patch) | |
tree | 683a93a02bf058f2d5a11fe39455a66ae5f041ae | |
parent | 8c53e42dea5905aee2a97e6af5874432f27b5c03 (diff) |
mwifiex: proper cleanup when RX multiport aggregation fails
Free SKBs allocated during multiport aggrgation setup when RX
multiport aggregation fails in the middle. With this handling
freeing SKB in mwifiex_process_int_status() for failure case
is removed.
Also handles single RX transaction failure.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/sdio.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 702452b505c3..d39d8457f252 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -1087,7 +1087,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter, | |||
1087 | (adapter->ioport | 0x1000 | | 1087 | (adapter->ioport | 0x1000 | |
1088 | (card->mpa_rx.ports << 4)) + | 1088 | (card->mpa_rx.ports << 4)) + |
1089 | card->mpa_rx.start_port, 1)) | 1089 | card->mpa_rx.start_port, 1)) |
1090 | return -1; | 1090 | goto error; |
1091 | 1091 | ||
1092 | curr_ptr = card->mpa_rx.buf; | 1092 | curr_ptr = card->mpa_rx.buf; |
1093 | 1093 | ||
@@ -1130,12 +1130,29 @@ rx_curr_single: | |||
1130 | if (mwifiex_sdio_card_to_host(adapter, &pkt_type, | 1130 | if (mwifiex_sdio_card_to_host(adapter, &pkt_type, |
1131 | skb->data, skb->len, | 1131 | skb->data, skb->len, |
1132 | adapter->ioport + port)) | 1132 | adapter->ioport + port)) |
1133 | return -1; | 1133 | goto error; |
1134 | 1134 | ||
1135 | mwifiex_decode_rx_packet(adapter, skb, pkt_type); | 1135 | mwifiex_decode_rx_packet(adapter, skb, pkt_type); |
1136 | } | 1136 | } |
1137 | 1137 | ||
1138 | return 0; | 1138 | return 0; |
1139 | |||
1140 | error: | ||
1141 | if (MP_RX_AGGR_IN_PROGRESS(card)) { | ||
1142 | /* Multiport-aggregation transfer failed - cleanup */ | ||
1143 | for (pind = 0; pind < card->mpa_rx.pkt_cnt; pind++) { | ||
1144 | /* copy pkt to deaggr buf */ | ||
1145 | skb_deaggr = card->mpa_rx.skb_arr[pind]; | ||
1146 | dev_kfree_skb_any(skb_deaggr); | ||
1147 | } | ||
1148 | MP_RX_AGGR_BUF_RESET(card); | ||
1149 | } | ||
1150 | |||
1151 | if (f_do_rx_cur) | ||
1152 | /* Single transfer pending. Free curr buff also */ | ||
1153 | dev_kfree_skb_any(skb); | ||
1154 | |||
1155 | return -1; | ||
1139 | } | 1156 | } |
1140 | 1157 | ||
1141 | /* | 1158 | /* |
@@ -1271,7 +1288,6 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter) | |||
1271 | 1288 | ||
1272 | dev_dbg(adapter->dev, | 1289 | dev_dbg(adapter->dev, |
1273 | "info: CFG reg val =%x\n", cr); | 1290 | "info: CFG reg val =%x\n", cr); |
1274 | dev_kfree_skb_any(skb); | ||
1275 | return -1; | 1291 | return -1; |
1276 | } | 1292 | } |
1277 | } | 1293 | } |