On Wed, 2022-11-16 at 15:07 +1300, Gilad Itzkovitch wrote: > > + /* Short head is not a mandatory field */ > + new_short_head_len = 0; > + if (params->short_head) > + new_short_head_len = params->short_head_len; > + else > + if (old && old->short_head) > + new_short_head_len = old->short_head_len; "else if (...)" would seem nicer and save the indentation level > + if (params->short_head) > + memcpy(new->short_head, params->short_head, new_short_head_len); > + else > + if (old && old->short_head) > + memcpy(new->short_head, old->short_head, new_short_head_len); same here > + > /* copy in optional tail */ > if (params->tail) > memcpy(new->tail, params->tail, new_tail_len); > @@ -1177,6 +1204,13 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata, > if (old) > memcpy(new->tail, old->tail, new_tail_len); > > + /* copy in optional short tail */ > + if (params->short_tail) > + memcpy(new->short_tail, params->short_tail, new_short_tail_len); > + else > + if (old) > + memcpy(new->short_tail, old->short_tail, new_short_tail_len); and here. And also here I'm a bit worried about hitting all these code paths when it's not S1G? johannes