> From: linux-wireless-owner@xxxxxxxxxxxxxxx [mailto:linux-wireless-owner@xxxxxxxxxxxxxxx] On Behalf Of Johannes Berg > > On Thu, 2018-05-17 at 11:43 -0700, Jeff Johnson wrote: > > > > > - msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL); > > > + msg = nlmsg_new(100 + ft_event->ies_len + ft_event->ric_ies_len, > > > + GFP_KERNEL); > > > if (!msg) > > > return; > > > > should these really be nla_total_size(ft_event->ies_len) + > > nla_total_size(ft_event->ric_ies_len) to properly account for the NLA > > header + padding? or do we consider that to be noise captured by the > > "100"? > > We do, technically we should have something like nla_total_size() of various things including all those wiphy, ifindex, MAC attributes etc. > so we just get lazy... nla_total_size is currently not used in nl80211.c (actually not used in net\wireless\ for that matters). IMO, switching nl80211/cfg80211 to use nla_total_size should be done separately. This patch is for fixing a very specific and small bug. Using nla_total_size in a single function in the file (cfg80211_ft_event) would be awkward. Thanks, Dedy.