Subject: Re: [PATCH v8 3/5] mac80211_hwsim: add PMSR request support via virtio

From: Simon Horman <[email-masked]>
Date: Mon, 6 Mar 2023 22:11:25 +0100

On Mon, Mar 06, 2023 at 09:45:16PM +0100, Johannes Berg wrote:
> On Mon, 2023-03-06 at 18:12 +0100, Simon Horman wrote:
> > 
> > >  
> > > +static int mac80211_hwsim_send_pmsr_ftm_request_peer(struct sk_buff *msg,
> > > +						     struct cfg80211_pmsr_ftm_request_peer *request)
> > > +{
> > > +	struct nlattr *ftm;
> > > +
> > > +	if (!request->requested)
> > > +		return -EINVAL;
> > > +
> > > +	ftm = nla_nest_start(msg, NL80211_PMSR_TYPE_FTM);
> > > +	if (!ftm)
> > > +		return -ENOBUFS;
> > > +
> > > +	if (nla_put_u32(msg, NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE, request->preamble))
> > 
> > nit: I suspect that you need to invoke nla_nest_cancel() in
> >      error paths to unwind nla_nest_start() calls.
> 
> The entire message is discarded if that happens, I think? Doesn't seem
> all that necessary in that case.

Thanks. I was wondering about that, but forgot to add it to my review message.