summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2016-12-03 11:27:37 +0100
committerKalle Valo <kvalo@codeaurora.org>2017-01-19 13:38:43 +0100
commit259010c509b6f28b3b851ae45238cf526f52e185 (patch)
tree30b1734db15cb11a26aebe237e60a947d3f6392b /drivers/net/wireless/marvell
parentrtlwifi: rtl8192de: Remove a pointless goto (diff)
downloadlinux-259010c509b6f28b3b851ae45238cf526f52e185.tar.xz
linux-259010c509b6f28b3b851ae45238cf526f52e185.zip
libertas: fix improper return value
Function lbs_cmd_802_11_sleep_params() always return 0, even if the call to lbs_cmd_with_response() fails. In this case, the parameter @sp will keep uninitialized. Because the return value is 0, its caller (say lbs_sleepparams_read()) will not detect the error, and will copy the uninitialized stack memory to user sapce, resulting in stack information leak. To avoid the bug, this patch returns variable ret (which takes the return value of lbs_cmd_with_response()) instead of 0. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188451 Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r--drivers/net/wireless/marvell/libertas/cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/libertas/cmd.c b/drivers/net/wireless/marvell/libertas/cmd.c
index 301170cccfff..033ff881c751 100644
--- a/drivers/net/wireless/marvell/libertas/cmd.c
+++ b/drivers/net/wireless/marvell/libertas/cmd.c
@@ -305,7 +305,7 @@ int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
}
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
- return 0;
+ return ret;
}
static int lbs_wait_for_ds_awake(struct lbs_private *priv)