From 0a060288f2eb0da53a2a892d02a412ce5c0c88b5 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Thu, 26 Jul 2012 14:42:10 +0200 Subject: [PATCH] --- yaml --- r: 327672 b: refs/heads/master c: c0af07340aae5db9f976bfe71e2e9bcab3169409 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/mac80211/main.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 11153255ac9c..5717fe89009a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9b8648704358e42f9865cd6de7cedb5ac0db67e7 +refs/heads/master: c0af07340aae5db9f976bfe71e2e9bcab3169409 diff --git a/trunk/net/mac80211/main.c b/trunk/net/mac80211/main.c index e706f9e5b051..bd7529363193 100644 --- a/trunk/net/mac80211/main.c +++ b/trunk/net/mac80211/main.c @@ -545,6 +545,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, int priv_size, i; struct wiphy *wiphy; + if (WARN_ON(!ops->tx || !ops->start || !ops->stop || !ops->config || + !ops->add_interface || !ops->remove_interface || + !ops->configure_filter)) + return NULL; + if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove))) return NULL; @@ -597,13 +602,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, local->hw.priv = (char *)local + ALIGN(sizeof(*local), NETDEV_ALIGN); - BUG_ON(!ops->tx); - BUG_ON(!ops->start); - BUG_ON(!ops->stop); - BUG_ON(!ops->config); - BUG_ON(!ops->add_interface); - BUG_ON(!ops->remove_interface); - BUG_ON(!ops->configure_filter); local->ops = ops; /* set up some defaults */