Hi Denis,

(huh, why did your mail make it to my inbox 3 hours ago ...? oh well)

> > +           kfree(attrbuf);
> > +           if (IS_ERR(*wdev)) {
> > +                   kfree(attrbuf);
> 
> Hmm, you just freed attrbuf above?

Good catch.

I was being stupid, wrote the patch on one machine, then tested & fixed
it on another, and then sent out the original ...

> >     if (!attrbuf[NL80211_ATTR_VENDOR_ID] ||
> > -       !attrbuf[NL80211_ATTR_VENDOR_SUBCMD])
> > -           return -EINVAL;
> > +       !attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) {
> > +           err = -EINVAL;
> > +           goto out;
> > +   }
> 
> Might be nicer to just set err = -EINVAL before the if instead of using 
> {} here

Dunno. I don't generally like the values "leaking" out of where they're
intended, tends to hide compiler warnings when you forget to assign or
something ... I guess doing -EINVAL at least would fail safely :-)

I'll revise this then.

johannes

Reply via email to