]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.170/b43-fix-error-in-cordic-routine.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.170 / b43-fix-error-in-cordic-routine.patch
1 From 8ea3819c0bbef57a51d8abe579e211033e861677 Mon Sep 17 00:00:00 2001
2 From: Larry Finger <Larry.Finger@lwfinger.net>
3 Date: Mon, 19 Nov 2018 20:01:24 +0200
4 Subject: b43: Fix error in cordic routine
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Larry Finger <Larry.Finger@lwfinger.net>
10
11 commit 8ea3819c0bbef57a51d8abe579e211033e861677 upstream.
12
13 The cordic routine for calculating sines and cosines that was added in
14 commit 6f98e62a9f1b ("b43: update cordic code to match current specs")
15 contains an error whereby a quantity declared u32 can in fact go negative.
16
17 This problem was detected by Priit Laes who is switching b43 to use the
18 routine in the library functions of the kernel.
19
20 Fixes: 986504540306 ("b43: make cordic common (LP-PHY and N-PHY need it)")
21 Reported-by: Priit Laes <plaes@plaes.org>
22 Cc: Rafał Miłecki <zajec5@gmail.com>
23 Cc: Stable <stable@vger.kernel.org> # 2.6.34
24 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
25 Signed-off-by: Priit Laes <plaes@plaes.org>
26 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28
29 ---
30 drivers/net/wireless/b43/phy_common.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 --- a/drivers/net/wireless/b43/phy_common.c
34 +++ b/drivers/net/wireless/b43/phy_common.c
35 @@ -616,7 +616,7 @@ struct b43_c32 b43_cordic(int theta)
36 u8 i;
37 s32 tmp;
38 s8 signx = 1;
39 - u32 angle = 0;
40 + s32 angle = 0;
41 struct b43_c32 ret = { .i = 39797, .q = 0, };
42
43 while (theta > (180 << 16))