On Tue, May 13, 2014 at 07:52:47PM -0700, Bing Zhao wrote: > Hi James, > > > G'day, > > > > Is there a short duration leak of wr_port in > > mwifiex_sdio_host_to_card()? > > You are right. There is a leak in the error case. Thanks for > pointing it out. Thanks. > > If mwifiex_host_to_card_mp_aggr fails because of is_suspended in > > mwifiex_write_data_sync, is the wr_port ever released? > > > > Or maybe mp_wr_bitmap is re-read from the card when a download > > interrupt occurs, or if an upload interrupt occurs after a command is > > sent. > > A patch has been sent to address this issue. Reviewed, thanks. Functionally identical to a patch that I've been testing locally: /* * Rollback the effects of _get_wr_port above. */ static void mwifiex_put_wr_port(struct mwifiex_adapter *adapter, u8 port) { struct sdio_mmc_card *card = adapter->card; card->mp_wr_bitmap |= (1 << port); card->curr_wr_port = port; } ... if (type == MWIFIEX_TYPE_DATA) { mwifiex_put_wr_port(adapter, port); adapter->data_sent = false; } You may be interested that rd_port also has possible leak when skb cannot be allocated. See mwifiex_process_int_status: skb = dev_alloc_skb(rx_len); if (!skb) return -1; We have a hack in OLPC production arm-3.5 kernel which restores rd_port bit, restores int_status. http://dev.laptop.org/git/olpc-kernel/commit/?h=arm-3.5&id=59fcaf10cce5bbdc370ec1c262b12aeb66ed1dca -- James Cameron http://quozl.linux.org.au/ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html