summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2018-11-19 20:01:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-13 10:07:12 +0100
commita246a603cee766ba72aaeeddebe455c95c770fab (patch)
tree2343403245f0331303d908a5fd12ac18d7089a45 /drivers/net
parent69473af5e6dc07348385e8d011dd0d3b0d95f07a (diff)
downloadlinux-stable-a246a603cee766ba72aaeeddebe455c95c770fab.tar.gz
linux-stable-a246a603cee766ba72aaeeddebe455c95c770fab.tar.bz2
linux-stable-a246a603cee766ba72aaeeddebe455c95c770fab.zip
b43: Fix error in cordic routine
commit 8ea3819c0bbef57a51d8abe579e211033e861677 upstream. 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 <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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/phy_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index ee27b06074e1..eb7ae64a6a26 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -609,7 +609,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))