Skip to content

Commit

Permalink
mac80211: warn only once in check_sdata_in_driver() at each caller
Browse files Browse the repository at this point in the history
Ben Greear has repeatedly reported in the past (for a few years
probably) that this triggers repeatedly in certain scenarios.

Make this a macro so that each callsite can trigger the warning
only once - that will still give us an idea of what's going on
and what paths can reach it, but avoids being too noisy.

Link: https://lore.kernel.org/r/20200730155212.06fd3a95dbfb.I0b16829aabfaf5f642bce401502a29d16e2dd444@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jul 31, 2020
1 parent f966227 commit c8ad010
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
#include "ieee80211_i.h"
#include "trace.h"

static inline bool check_sdata_in_driver(struct ieee80211_sub_if_data *sdata)
{
return !WARN(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER),
"%s: Failed check-sdata-in-driver check, flags: 0x%x\n",
sdata->dev ? sdata->dev->name : sdata->name, sdata->flags);
}
#define check_sdata_in_driver(sdata) ({ \
!WARN_ONCE(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER), \
"%s: Failed check-sdata-in-driver check, flags: 0x%x\n", \
sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); \
})

static inline struct ieee80211_sub_if_data *
get_bss_sdata(struct ieee80211_sub_if_data *sdata)
Expand Down

0 comments on commit c8ad010

Please sign in to comment.