ath5k: channel change fix
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 305-b43-fix-NULL-pointer-dereference-in-b43_phy_copy.patch
1 From: Hauke Mehrtens <hauke@hauke-m.de>
2 Date: Wed, 5 Nov 2014 23:31:07 +0100
3 Subject: [PATCH] b43: fix NULL pointer dereference in b43_phy_copy()
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
7
8 phy_read and phy_write are not set for every phy any more sine this:
9 commit d342b95dd735014a590f9051b1ba227eb54ca8f6
10 Author: Rafał Miłecki <zajec5@gmail.com>
11 Date: Thu Jul 31 21:59:43 2014 +0200
12
13 b43: don't duplicate common PHY read/write ops
14
15 b43_phy_copy() accesses phy_read and phy_write directly and will fail
16 with some phys. This patch fixes the regression by using the
17 b43_phy_read() and b43_phy_write() functions which should be used for
18 read and write access.
19
20 This should fix this bug report:
21 https://bugzilla.kernel.org/show_bug.cgi?id=87731
22
23 Reported-by: Volker Kempter <v.kempter@pe.tu-clausthal.de>
24 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
25 ---
26
27 --- a/drivers/net/wireless/b43/phy_common.c
28 +++ b/drivers/net/wireless/b43/phy_common.c
29 @@ -301,8 +301,7 @@ void b43_phy_write(struct b43_wldev *dev
30 void b43_phy_copy(struct b43_wldev *dev, u16 destreg, u16 srcreg)
31 {
32 assert_mac_suspended(dev);
33 - dev->phy.ops->phy_write(dev, destreg,
34 - dev->phy.ops->phy_read(dev, srcreg));
35 + b43_phy_write(dev, destreg, b43_phy_read(dev, srcreg));
36 }
37
38 void b43_phy_mask(struct b43_wldev *dev, u16 offset, u16 mask)