305-b43-fix-NULL-pointer-dereference-in-b43_phy_copy.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. phy_read and phy_write are not set for every phy any more sine this:
  8. commit d342b95dd735014a590f9051b1ba227eb54ca8f6
  9. Author: Rafał Miłecki <zajec5@gmail.com>
  10. Date: Thu Jul 31 21:59:43 2014 +0200
  11. b43: don't duplicate common PHY read/write ops
  12. b43_phy_copy() accesses phy_read and phy_write directly and will fail
  13. with some phys. This patch fixes the regression by using the
  14. b43_phy_read() and b43_phy_write() functions which should be used for
  15. read and write access.
  16. This should fix this bug report:
  17. https://bugzilla.kernel.org/show_bug.cgi?id=87731
  18. Reported-by: Volker Kempter <v.kempter@pe.tu-clausthal.de>
  19. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  20. ---
  21. --- a/drivers/net/wireless/b43/phy_common.c
  22. +++ b/drivers/net/wireless/b43/phy_common.c
  23. @@ -301,8 +301,7 @@ void b43_phy_write(struct b43_wldev *dev
  24. void b43_phy_copy(struct b43_wldev *dev, u16 destreg, u16 srcreg)
  25. {
  26. assert_mac_suspended(dev);
  27. - dev->phy.ops->phy_write(dev, destreg,
  28. - dev->phy.ops->phy_read(dev, srcreg));
  29. + b43_phy_write(dev, destreg, b43_phy_read(dev, srcreg));
  30. }
  31. void b43_phy_mask(struct b43_wldev *dev, u16 offset, u16 mask)