]> Git Repo - linux.git/commitdiff
b43: Fix error in cordic routine
authorLarry Finger <[email protected]>
Mon, 19 Nov 2018 18:01:24 +0000 (20:01 +0200)
committerKalle Valo <[email protected]>
Thu, 29 Nov 2018 15:30:49 +0000 (17:30 +0200)
The cordic routine for calculating sines and cosines that was added in
commit 6f98e62a9f1b ("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: 986504540306 ("b43: make cordic common (LP-PHY and N-PHY need it)")
Reported-by: Priit Laes <[email protected]>
Cc: Rafał Miłecki <[email protected]>
Cc: Stable <[email protected]> # 2.6.34
Signed-off-by: Larry Finger <[email protected]>
Signed-off-by: Priit Laes <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
drivers/net/wireless/broadcom/b43/phy_common.c

index 85f2ca98956567bd28599fbe4d1499e549a1f425..ef3ffa5ad4668d3a4b3e630aab2eb8ba8d717fbe 100644 (file)
@@ -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))
This page took 0.053118 seconds and 4 git commands to generate.