Skip to content

Commit

Permalink
[PATCH] rtl8187: ensure priv->hwaddr is always valid
Browse files Browse the repository at this point in the history
conf->mac_addr is not guaranteed to be set. This ensures priv->hwaddr is
always set to a valid mac address. Thanks to Johannes Berg
<johannes@sipsolutions.net> for finding this problem.

Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Michael Wu authored and John W. Linville committed Aug 6, 2007
1 parent 313b0d3 commit c43bff4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
return -EOPNOTSUPP;
}

priv->hwaddr = conf->mac_addr;
priv->hwaddr = conf->mac_addr ? conf->mac_addr : dev->wiphy->perm_addr;

return 0;
}
Expand Down

0 comments on commit c43bff4

Please sign in to comment.