[PATCH] rtl8187: ensure priv->hwaddr is always valid

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>
This commit is contained in:
Michael Wu 2007-07-15 17:09:55 -07:00 committed by John W. Linville
parent 313b0d3d86
commit c43bff43e0
1 changed files with 1 additions and 1 deletions

View File

@ -466,7 +466,7 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
priv->hwaddr = conf->mac_addr; priv->hwaddr = conf->mac_addr ? conf->mac_addr : dev->wiphy->perm_addr;
return 0; return 0;
} }