diff options
author | Andreas Kemnade <andreas@kemnade.info> | 2016-01-30 18:01:51 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-02-06 14:02:09 +0200 |
commit | 0a7701b4defcebc7ce461355e6d9478df313b084 (patch) | |
tree | 27b3f3d83ae209774037d244d4725965ead92ea7 /drivers/net/wireless/marvell/libertas/cmdresp.c | |
parent | efdf0e393e76aa18e9c2ec0ca9b3a71ad410994b (diff) | |
download | lwn-0a7701b4defcebc7ce461355e6d9478df313b084.tar.gz lwn-0a7701b4defcebc7ce461355e6d9478df313b084.zip |
libertas: fix pointer bugs for PS_MODE commands
struct cmd_ds_802_11_ps_mode
contains the command header and a pointer to it was
initialized with data points to the body which leads to
mis-interpretation of the cmd_ds_802_11_ps_mode.action member.
cmd[0] contains the header, &cmd[1] points beyond that.
cmdnode->cmdbuf is a pointer to the command buffer
This piece of code was unused since power saving was
not enabled.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/marvell/libertas/cmdresp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/libertas/cmdresp.c b/drivers/net/wireless/marvell/libertas/cmdresp.c index e5442e8956f7..701125f9b060 100644 --- a/drivers/net/wireless/marvell/libertas/cmdresp.c +++ b/drivers/net/wireless/marvell/libertas/cmdresp.c @@ -123,7 +123,10 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) priv->cmd_timed_out = 0; if (respcmd == CMD_RET(CMD_802_11_PS_MODE)) { - struct cmd_ds_802_11_ps_mode *psmode = (void *) &resp[1]; + /* struct cmd_ds_802_11_ps_mode also contains + * the header + */ + struct cmd_ds_802_11_ps_mode *psmode = (void *)resp; u16 action = le16_to_cpu(psmode->action); lbs_deb_host( |