aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2015-10-25 04:59:41 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-11-03 04:40:59 -0500
commit254d3dfe445f94a764e399ca12e04365ac9413ed (patch)
treeb2031c6f9be4205201b05445d755f48e0568452a
parent4baf6bea37247e59f1971e8009d13aeda95edba2 (diff)
mac80211: allow null chandef in tracing
In TDLS channel-switch operations the chandef can sometimes be NULL. Avoid an oops in the trace code for these cases and just print a chandef full of zeros. Cc: stable@vger.kernel.org Fixes: a7a6bdd0670fe ("mac80211: introduce TDLS channel switch ops") Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/trace.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 5cf8f4ea077f..56c6d6cfa5a1 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -33,11 +33,11 @@
33 __field(u32, chan_width) \ 33 __field(u32, chan_width) \
34 __field(u32, center_freq1) \ 34 __field(u32, center_freq1) \
35 __field(u32, center_freq2) 35 __field(u32, center_freq2)
36#define CHANDEF_ASSIGN(c) \ 36#define CHANDEF_ASSIGN(c) \
37 __entry->control_freq = (c)->chan ? (c)->chan->center_freq : 0; \ 37 __entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0; \
38 __entry->chan_width = (c)->width; \ 38 __entry->chan_width = (c) ? (c)->width : 0; \
39 __entry->center_freq1 = (c)->center_freq1; \ 39 __entry->center_freq1 = (c) ? (c)->center_freq1 : 0; \
40 __entry->center_freq2 = (c)->center_freq2; 40 __entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
41#define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz" 41#define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
42#define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \ 42#define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \
43 __entry->center_freq1, __entry->center_freq2 43 __entry->center_freq1, __entry->center_freq2