]> git.baikalelectronics.ru Git - kernel.git/commit
rt2x00: fix memory corruption in rf cache, add a sanity check
authorPavel Roskin <proski@gnu.org>
Tue, 4 Aug 2009 21:48:16 +0000 (17:48 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Aug 2009 13:06:52 +0000 (09:06 -0400)
commit447036f853af0702bf2476e9ae7c260d8fe6140d
treed6968f04884bcb8bf28f29a6ed8f0dc73ea191ef
parent82126cdcaae8db503a63388739d1b82319d01776
rt2x00: fix memory corruption in rf cache, add a sanity check

Change rt2x00_rf_read() and rt2x00_rf_write() to subtract 1 from the rf
register number.  This is needed because the rf registers are enumerated
starting with one.  The size of the rf register cache is just enough to
hold all registers, so writing to the highest register was corrupting
memory.  Add a check to make sure that the rf register number is valid.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Cc: stable@kernel.org
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00.h