mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
b43: Fix error in cordic routine
commit8ea3819c0bupstream. The cordic routine for calculating sines and cosines that was added in commit6f98e62a9f("b43: update cordic code to match current specs") contains an error whereby a quantity declared u32 can in fact go negative. This problem was detected by Priit Laes who is switching b43 to use the routine in the library functions of the kernel. Fixes:9865045403("b43: make cordic common (LP-PHY and N-PHY need it)") Reported-by: Priit Laes <plaes@plaes.org> Cc: Rafał Miłecki <zajec5@gmail.com> Cc: Stable <stable@vger.kernel.org> # 2.6.34 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Priit Laes <plaes@plaes.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6d75eb875b
commit
b274cc25da
@@ -616,7 +616,7 @@ struct b43_c32 b43_cordic(int theta)
|
||||
u8 i;
|
||||
s32 tmp;
|
||||
s8 signx = 1;
|
||||
u32 angle = 0;
|
||||
s32 angle = 0;
|
||||
struct b43_c32 ret = { .i = 39797, .q = 0, };
|
||||
|
||||
while (theta > (180 << 16))
|
||||
|
||||
Reference in New Issue
Block a user