mwifiex: overwrite earlier IE buffers for new set IE request
authorAvinash Patil <patila@marvell.com>
Fri, 29 Jun 2012 03:30:27 +0000 (20:30 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Jul 2012 20:35:59 +0000 (16:35 -0400)
All IE buffers are freshly supplied. In such case, there is no need
to preserve earlier buffers with same management mask and index.

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>
drivers/net/wireless/mwifiex/ie.c

index 018ae4a1b54494578ff6c2f3f417a18c629269ed..1f2d4b9a0ca5a61b1128ae5c51d86f0601ffb2a8 100644 (file)
@@ -51,8 +51,7 @@ mwifiex_ie_get_autoidx(struct mwifiex_private *priv, u16 subtype_mask,
 
        for (i = 0; i < priv->adapter->max_mgmt_ie_index; i++) {
                mask = le16_to_cpu(priv->mgmt_ie[i].mgmt_subtype_mask);
-               len = le16_to_cpu(priv->mgmt_ie[i].ie_length) +
-                     le16_to_cpu(ie->ie_length);
+               len = le16_to_cpu(ie->ie_length);
 
                if (mask == MWIFIEX_AUTO_IDX_MASK)
                        continue;
@@ -108,10 +107,8 @@ mwifiex_update_autoindex_ies(struct mwifiex_private *priv,
                                return -1;
 
                        tmp = (u8 *)&priv->mgmt_ie[index].ie_buffer;
-                       tmp += le16_to_cpu(priv->mgmt_ie[index].ie_length);
                        memcpy(tmp, &ie->ie_buffer, le16_to_cpu(ie->ie_length));
-                       le16_add_cpu(&priv->mgmt_ie[index].ie_length,
-                                    le16_to_cpu(ie->ie_length));
+                       priv->mgmt_ie[index].ie_length = ie->ie_length;
                        priv->mgmt_ie[index].ie_index = cpu_to_le16(index);
                        priv->mgmt_ie[index].mgmt_subtype_mask =
                                                        cpu_to_le16(mask);