From: Luis R. Rodriguez Date: Fri, 14 Nov 2008 22:44:22 +0000 (-0800) Subject: mac80211: don't assume driver has been attached on registration X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4ada424db196c78746fec255d493cacb1c9feddf;p=linux-beck.git mac80211: don't assume driver has been attached on registration mac80211's ieee80211_register_hw() is often called within the probe path so it cannot assume the device's driver structure has been attached yet so to create a workqueue instead of using driver->name use the wiphy's phy%d name. The name doesn't really matter anyway. This should fix sporadic oopses found when we race to beat the driver pointer setting. Not even sure how this was working properly. http://www.kerneloops.org/search.php?search=ieee80211_register_hw Signed-off-by: Luis R. Rodriguez Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/main.c b/net/mac80211/main.c index d631dc96c323..cec9b6d3e1ce 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -722,7 +722,6 @@ EXPORT_SYMBOL(ieee80211_alloc_hw); int ieee80211_register_hw(struct ieee80211_hw *hw) { struct ieee80211_local *local = hw_to_local(hw); - const char *name; int result; enum ieee80211_band band; struct net_device *mdev; @@ -787,8 +786,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) mdev->header_ops = &ieee80211_header_ops; mdev->set_multicast_list = ieee80211_master_set_multicast_list; - name = wiphy_dev(local->hw.wiphy)->driver->name; - local->hw.workqueue = create_freezeable_workqueue(name); + local->hw.workqueue = + create_freezeable_workqueue(wiphy_name(local->hw.wiphy)); if (!local->hw.workqueue) { result = -ENOMEM; goto fail_workqueue;