summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_plink.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-09-08 11:54:46 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-09-21 11:42:01 +0200
commit4c121fd690d9c465e4cb09b7859adfdd6a0aee1d (patch)
treea5a2bf2efa32f279f3792212d6ebe70b7158c00e /net/mac80211/mesh_plink.c
parentmac80211: Simplify locking in ieee80211_sta_tear_down_BA_sessions() (diff)
downloadlinux-4c121fd690d9c465e4cb09b7859adfdd6a0aee1d.tar.xz
linux-4c121fd690d9c465e4cb09b7859adfdd6a0aee1d.zip
mac80211: use offsetofend()
This was created using the following spatch: @find@ type S; expression M, M2; position p; @@ offsetof(S, M) + sizeof(M2)@p @script:python@ m << find.M; m2 << find.M2; @@ if not m2.endswith('-> ' + m): cocci.include_match(False) @change@ type find.S; expression find.M, find.M2; position find.p; @@ -offsetof(S, M) + sizeof(M2)@p +offsetofend(S, M) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r--net/mac80211/mesh_plink.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index f69c6c38ca43..dc8e10f87207 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -220,8 +220,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
bool include_plid = false;
u16 peering_proto = 0;
u8 *pos, ie_len = 4;
- int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.self_prot) +
- sizeof(mgmt->u.action.u.self_prot);
+ int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.self_prot);
int err = -ENOMEM;
skb = dev_alloc_skb(local->tx_headroom +