mac80211: don't assume channel is set in tracing

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:44 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3d01be72e6fe372a0602221090707a1f04c44646
Commit:     3d01be72e6fe372a0602221090707a1f04c44646
Parent:     f9e6e95b63758202fe2ce43bd7c922db2ff50f80
Author:     Johannes Berg <johannes.berg at intel.com>
AuthorDate: Thu Jul 26 14:27:39 2012 +0200
Committer:  Johannes Berg <johannes.berg at intel.com>
CommitDate: Mon Aug 20 14:13:42 2012 +0200

    mac80211: don't assume channel is set in tracing
    
    With the move to multi-channel and away from
    drv_config(), hw.conf.channel will not always
    be set, only for devices using the current API
    instead of the new channel context APIs. Check
    the channel is set before adding its frequency
    to the trace data.
    
    Also break some overly long lines in the code.
    
    Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 net/mac80211/trace.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 65e9a2a..18d9c8a 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -274,9 +274,12 @@ TRACE_EVENT(drv_config,
 		__entry->dynamic_ps_timeout = local->hw.conf.dynamic_ps_timeout;
 		__entry->max_sleep_period = local->hw.conf.max_sleep_period;
 		__entry->listen_interval = local->hw.conf.listen_interval;
-		__entry->long_frame_max_tx_count = local->hw.conf.long_frame_max_tx_count;
-		__entry->short_frame_max_tx_count = local->hw.conf.short_frame_max_tx_count;
-		__entry->center_freq = local->hw.conf.channel->center_freq;
+		__entry->long_frame_max_tx_count =
+			local->hw.conf.long_frame_max_tx_count;
+		__entry->short_frame_max_tx_count =
+			local->hw.conf.short_frame_max_tx_count;
+		__entry->center_freq = local->hw.conf.channel ?
+					local->hw.conf.channel->center_freq : 0;
 		__entry->channel_type = local->hw.conf.channel_type;
 		__entry->smps = local->hw.conf.smps_mode;
 	),



More information about the linux-mtd-cvs mailing list