mwifiex: reset skb length before inserting to free queue
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 22 Sep 2011 04:43:25 +0000 (21:43 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Sep 2011 18:34:04 +0000 (14:34 -0400)
After handling command response, cmd skb is inserted into command
free queue(which keeps track of availabile skbs) for reuse purpose.
Skb length is not getting reset to zero here. This patch takes care
of it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/cmdevt.c

index b5352afb8714884752474936dc8a031b611ecbf3..d12e25d0c88060c5d8968ee504894b57f64f4f77 100644 (file)
@@ -90,6 +90,9 @@ mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter,
        cmd_node->data_buf = NULL;
        cmd_node->wait_q_enabled = false;
 
+       if (cmd_node->cmd_skb)
+               skb_trim(cmd_node->cmd_skb, 0);
+
        if (cmd_node->resp_skb) {
                dev_kfree_skb_any(cmd_node->resp_skb);
                cmd_node->resp_skb = NULL;