Commit 1cf69ac9 authored by Larry Finger's avatar Larry Finger Committed by Juerg Haefliger

b43: Fix error in cordic routine

BugLink: https://bugs.launchpad.net/bugs/1811647

commit 8ea3819c upstream.

The cordic routine for calculating sines and cosines that was added in
commit 6f98e62a ("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: 98650454 ("b43: make cordic common (LP-PHY and N-PHY need it)")
Reported-by: default avatarPriit Laes <plaes@plaes.org>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Stable <stable@vger.kernel.org> # 2.6.34
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarPriit Laes <plaes@plaes.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent f35f9e04
...@@ -616,7 +616,7 @@ struct b43_c32 b43_cordic(int theta) ...@@ -616,7 +616,7 @@ struct b43_c32 b43_cordic(int theta)
u8 i; u8 i;
s32 tmp; s32 tmp;
s8 signx = 1; s8 signx = 1;
u32 angle = 0; s32 angle = 0;
struct b43_c32 ret = { .i = 39797, .q = 0, }; struct b43_c32 ret = { .i = 39797, .q = 0, };
while (theta > (180 << 16)) while (theta > (180 << 16))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment