Skip to content

Commit

Permalink
drivers: net: wireless: b43: Fix possible NULL ptr dereference
Browse files Browse the repository at this point in the history
On the ternary expression the 'e' variable could be NULL dereferenced,
when b43_nphy_get_rf_ctl_over_rev7 function returns NULL.

Signed-off-by: Felipe Pena <felipensp@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Felipe Pena authored and John W. Linville committed Oct 18, 2013
1 parent 36165fd commit 8ce9bea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/b43/phy_n.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ static void b43_nphy_rf_ctl_override_rev7(struct b43_wldev *dev, u16 field,
}
en_addr = en_addrs[override][i];

val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;
if (e)
val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;

if (off) {
b43_phy_mask(dev, en_addr, ~en_mask);
Expand Down

0 comments on commit 8ce9bea

Please sign in to comment.