diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2009-01-23 12:30:11 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:28 -0500 |
commit | 66aafd9a3108da465a73bd755366416e75fb9d3d (patch) | |
tree | 1ba22f4d3800d7892f46f2e442d366aaa21249d6 /drivers/net/wireless/rtl818x | |
parent | 1fac36ee7d5a0611e1216b02b485b154c8aa6dad (diff) |
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: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_dev.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 22bc07ef2f37..313ede7d7b49 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -974,19 +974,21 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev, | |||
974 | { | 974 | { |
975 | struct rtl8187_priv *priv = dev->priv; | 975 | struct rtl8187_priv *priv = dev->priv; |
976 | int i; | 976 | int i; |
977 | int ret = -EOPNOTSUPP; | ||
977 | 978 | ||
979 | mutex_lock(&priv->conf_mutex); | ||
978 | if (priv->mode != NL80211_IFTYPE_MONITOR) | 980 | if (priv->mode != NL80211_IFTYPE_MONITOR) |
979 | return -EOPNOTSUPP; | 981 | goto exit; |
980 | 982 | ||
981 | switch (conf->type) { | 983 | switch (conf->type) { |
982 | case NL80211_IFTYPE_STATION: | 984 | case NL80211_IFTYPE_STATION: |
983 | priv->mode = conf->type; | 985 | priv->mode = conf->type; |
984 | break; | 986 | break; |
985 | default: | 987 | default: |
986 | return -EOPNOTSUPP; | 988 | goto exit; |
987 | } | 989 | } |
988 | 990 | ||
989 | mutex_lock(&priv->conf_mutex); | 991 | ret = 0; |
990 | priv->vif = conf->vif; | 992 | priv->vif = conf->vif; |
991 | 993 | ||
992 | rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); | 994 | 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 | ((u8 *)conf->mac_addr)[i]); | 997 | ((u8 *)conf->mac_addr)[i]); |
996 | rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); | 998 | rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); |
997 | 999 | ||
1000 | exit: | ||
998 | mutex_unlock(&priv->conf_mutex); | 1001 | mutex_unlock(&priv->conf_mutex); |
999 | return 0; | 1002 | return ret; |
1000 | } | 1003 | } |
1001 | 1004 | ||
1002 | static void rtl8187_remove_interface(struct ieee80211_hw *dev, | 1005 | static void rtl8187_remove_interface(struct ieee80211_hw *dev, |