diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-16 16:51:27 -0700 | 
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-16 16:51:27 -0700 | 
| commit | 8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e (patch) | |
| tree | 88cd7852d59ebae54fcc2f57019ea13284042962 /drivers/net/wireless/mwifiex/cmdevt.c | |
| parent | 6f586e663e3b3674cadad0d5329424b006a0a289 (diff) | |
| parent | 5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff) | |
| download | olio-linux-3.10-8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e.tar.xz olio-linux-3.10-8f949b9a7e0bac3a9c3c29dc27c476a87e21db3e.zip  | |
Merge 3.6-rc7 into driver-core-next
This pulls in the fixes in that branch that are needed here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 c68adec3cc8..565527aee0e 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,  	cmd_code = le16_to_cpu(host_cmd->command);  	cmd_size = le16_to_cpu(host_cmd->size); -	skb_trim(cmd_node->cmd_skb, cmd_size); +	/* Adjust skb length */ +	if (cmd_node->cmd_skb->len > cmd_size) +		/* +		 * cmd_size is less than sizeof(struct host_cmd_ds_command). +		 * Trim off the unused portion. +		 */ +		skb_trim(cmd_node->cmd_skb, cmd_size); +	else if (cmd_node->cmd_skb->len < cmd_size) +		/* +		 * cmd_size is larger than sizeof(struct host_cmd_ds_command) +		 * because we have appended custom IE TLV. Increase skb length +		 * accordingly. +		 */ +		skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len);  	do_gettimeofday(&tstamp);  	dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d,"  |