All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rt2x00: fix NULL pointer exception
@ 2007-02-28 22:08 Ivo van Doorn
  0 siblings, 0 replies; only message in thread
From: Ivo van Doorn @ 2007-02-28 22:08 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

This will fix a NULL pointer exception when working in master mode.
When a master mode interface is added, the bssid is initialized,
when config_interface() is called the bssid is invalid (only with master mode)
so we cannot use that, instead the bssid inside the interface structure should
be used.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

---

diff --git a/drivers/net/wireless/mac80211/rt2x00/rt2x00lib.c b/drivers/net/wireless/mac80211/rt2x00/rt2x00lib.c
index e882182..8dacf00 100644
--- a/drivers/net/wireless/mac80211/rt2x00/rt2x00lib.c
+++ b/drivers/net/wireless/mac80211/rt2x00/rt2x00lib.c
@@ -480,6 +480,7 @@ int rt2x00lib_config_interface(struct ieee80211_hw *hw, int if_id,
 	struct ieee80211_if_conf *conf)
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
+	struct interface *intf = &rt2x00dev->interface;
 
 	/*
 	 * Monitor mode does not need configuring.
@@ -488,7 +489,7 @@ int rt2x00lib_config_interface(struct ieee80211_hw *hw, int if_id,
 	 */
 	if (conf->type == IEEE80211_IF_TYPE_MNTR)
 		return 0;
-	else if (conf->type != rt2x00dev->interface.type)
+	else if (conf->type != intf->type)
 		return -EINVAL;
 
 	/*
@@ -497,13 +498,13 @@ int rt2x00lib_config_interface(struct ieee80211_hw *hw, int if_id,
 	 * should now be set.
 	 */
 	if (conf->type != IEEE80211_IF_TYPE_AP)
-		memcpy(&rt2x00dev->interface.bssid, conf->bssid, ETH_ALEN);
+		memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
 
 	/*
 	 * Enable configuration.
 	 */
 	rt2x00dev->lib_ops->config_type(rt2x00dev, conf->type);
-	rt2x00dev->lib_ops->config_bssid(rt2x00dev, conf->bssid);
+	rt2x00dev->lib_ops->config_bssid(rt2x00dev, intf->bssid);
 
 	return 0;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-28 22:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-28 22:08 [PATCH] rt2x00: fix NULL pointer exception Ivo van Doorn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.