From: Michael Wu Date: Mon, 16 Jul 2007 00:09:55 +0000 (-0700) Subject: [PATCH] rtl8187: ensure priv->hwaddr is always valid X-Git-Tag: v2.6.23-rc3~86^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c43bff43e0617dd56515b4ea42a8037c699c86f1;p=linux-2.6 [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 for finding this problem. Signed-off-by: Michael Wu Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index cea85894b7..e61c6d5ba1 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c @@ -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; }