mwifiex: fix invalid memory access in mwifiex_get_power_level()
authorAmitkumar Karwar <akarwar@marvell.com>
Tue, 22 Oct 2013 22:24:44 +0000 (15:24 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Nov 2013 19:38:56 +0000 (14:38 -0500)
commitfe1c9a443e0d1e0af790883f091fb1c4f418bc8f
tree5bb5700952ca24730ebd1f253353290d38a29b0e
parent930fd35c8de88cc1ce934aa655181c4879422a37
mwifiex: fix invalid memory access in mwifiex_get_power_level()

With "while (length)" check we may end up in accessing invalid
memory in last iteration.
This patch makes sure that tlv length is not less than the length
of structure mwifiex_power_group when min/max power is calculated.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/sta_cmdresp.c