提交 66aafd9a 编写于 作者: L Larry Finger 提交者: John W. Linville

rtl8187: Fix locking of private data

In rtl8187_add_interface(), the mutex that protects the data in struct
rtl8187_priv does not include all references to that structure.
Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 1fac36ee
...@@ -974,19 +974,21 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev, ...@@ -974,19 +974,21 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
{ {
struct rtl8187_priv *priv = dev->priv; struct rtl8187_priv *priv = dev->priv;
int i; int i;
int ret = -EOPNOTSUPP;
mutex_lock(&priv->conf_mutex);
if (priv->mode != NL80211_IFTYPE_MONITOR) if (priv->mode != NL80211_IFTYPE_MONITOR)
return -EOPNOTSUPP; goto exit;
switch (conf->type) { switch (conf->type) {
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
priv->mode = conf->type; priv->mode = conf->type;
break; break;
default: default:
return -EOPNOTSUPP; goto exit;
} }
mutex_lock(&priv->conf_mutex); ret = 0;
priv->vif = conf->vif; priv->vif = conf->vif;
rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG);
...@@ -995,8 +997,9 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev, ...@@ -995,8 +997,9 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev,
((u8 *)conf->mac_addr)[i]); ((u8 *)conf->mac_addr)[i]);
rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL);
exit:
mutex_unlock(&priv->conf_mutex); mutex_unlock(&priv->conf_mutex);
return 0; return ret;
} }
static void rtl8187_remove_interface(struct ieee80211_hw *dev, static void rtl8187_remove_interface(struct ieee80211_hw *dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册