Skip to content

Commit 8ea3819

Browse files
lwfingerKalle Valo
authored andcommitted
b43: Fix error in cordic routine
The cordic routine for calculating sines and cosines that was added in commit 6f98e62 ("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: 9865045 ("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>
1 parent ea3edda commit 8ea3819

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wireless/broadcom/b43/phy_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ struct b43_c32 b43_cordic(int theta)
616616
u8 i;
617617
s32 tmp;
618618
s8 signx = 1;
619-
u32 angle = 0;
619+
s32 angle = 0;
620620
struct b43_c32 ret = { .i = 39797, .q = 0, };
621621

622622
while (theta > (180 << 16))

0 commit comments

Comments
 (0)