Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Commit db96a3c

Browse files
ariknemgregkh
authored andcommitted
mac80211: allow null chandef in tracing
commit 254d3df 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: a7a6bdd ("mac80211: introduce TDLS channel switch ops") Signed-off-by: Arik Nemtsov <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 85eeb5c commit db96a3c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/mac80211/trace.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
__field(u32, chan_width) \
3434
__field(u32, center_freq1) \
3535
__field(u32, center_freq2)
36-
#define CHANDEF_ASSIGN(c) \
37-
__entry->control_freq = (c)->chan ? (c)->chan->center_freq : 0; \
38-
__entry->chan_width = (c)->width; \
39-
__entry->center_freq1 = (c)->center_freq1; \
40-
__entry->center_freq2 = (c)->center_freq2;
36+
#define CHANDEF_ASSIGN(c) \
37+
__entry->control_freq = (c) ? ((c)->chan ? (c)->chan->center_freq : 0) : 0; \
38+
__entry->chan_width = (c) ? (c)->width : 0; \
39+
__entry->center_freq1 = (c) ? (c)->center_freq1 : 0; \
40+
__entry->center_freq2 = (c) ? (c)->center_freq2 : 0;
4141
#define CHANDEF_PR_FMT " control:%d MHz width:%d center: %d/%d MHz"
4242
#define CHANDEF_PR_ARG __entry->control_freq, __entry->chan_width, \
4343
__entry->center_freq1, __entry->center_freq2

0 commit comments

Comments
 (0)