]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mac80211: allow null chandef in tracing
authorArik Nemtsov <arik@wizery.com>
Sun, 25 Oct 2015 08:59:41 +0000 (10:59 +0200)
committerLuis Henriques <luis.henriques@canonical.com>
Sun, 13 Dec 2015 17:49:04 +0000 (17:49 +0000)
commit 254d3dfe445f94a764e399ca12e04365ac9413ed upstream.

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.

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>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
net/mac80211/trace.h

index cfe1a0688b5ce2846eb906b3f196c5cf51a4590b..569332bdb10f25dd7e397b94a7f3d6b8d7f1e815 100644 (file)
                        __field(u32, chan_width)                                        \
                        __field(u32, center_freq1)                                      \
                        __field(u32, center_freq2)
-#define CHANDEF_ASSIGN(c)                                                              \
-                       __entry->control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
-                       __entry->chan_width = (c)->width;                               \
-                       __entry->center_freq1 = (c)->center_freq1;                      \
-                       __entry->center_freq2 = (c)->center_freq2;
+#define CHANDEF_ASSIGN(c)                                                      \
+                       __entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0;     \
+                       __entry->chan_width = (c) ? (c)->width : 0;                     \
+                       __entry->center_freq1 = (c) ? (c)->center_freq1 : 0;            \
+                       __entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
 #define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
 #define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width,                     \
                        __entry->center_freq1, __entry->center_freq2