]> git.baikalelectronics.ru Git - kernel.git/commit
libertas: fix improper return value
authorPan Bian <bianpan2016@163.com>
Sat, 3 Dec 2016 10:27:37 +0000 (18:27 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 19 Jan 2017 12:38:43 +0000 (14:38 +0200)
commit8800afe7f6fc51e868af559592b44dd52bfd2858
tree30b1734db15cb11a26aebe237e60a947d3f6392b
parentba8f78958f8bb4c722c3f7c8195bf30f499c532f
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>
drivers/net/wireless/marvell/libertas/cmd.c