diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/cmdevt.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/cmdevt.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index c68adec3cc8b..565527aee0ea 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -170,7 +170,20 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, | |||
170 | cmd_code = le16_to_cpu(host_cmd->command); | 170 | cmd_code = le16_to_cpu(host_cmd->command); |
171 | cmd_size = le16_to_cpu(host_cmd->size); | 171 | cmd_size = le16_to_cpu(host_cmd->size); |
172 | 172 | ||
173 | skb_trim(cmd_node->cmd_skb, cmd_size); | 173 | /* Adjust skb length */ |
174 | if (cmd_node->cmd_skb->len > cmd_size) | ||
175 | /* | ||
176 | * cmd_size is less than sizeof(struct host_cmd_ds_command). | ||
177 | * Trim off the unused portion. | ||
178 | */ | ||
179 | skb_trim(cmd_node->cmd_skb, cmd_size); | ||
180 | else if (cmd_node->cmd_skb->len < cmd_size) | ||
181 | /* | ||
182 | * cmd_size is larger than sizeof(struct host_cmd_ds_command) | ||
183 | * because we have appended custom IE TLV. Increase skb length | ||
184 | * accordingly. | ||
185 | */ | ||
186 | skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); | ||
174 | 187 | ||
175 | do_gettimeofday(&tstamp); | 188 | do_gettimeofday(&tstamp); |
176 | dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," | 189 | dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," |