Date: Fri, 19 Aug 2011 12:41:09 +0800 From: Adrian Chadd <adrian@freebsd.org> To: PseudoCylon <moonlightakkiy@yahoo.ca> Cc: freebsd-wireless@freebsd.org Subject: Re: ieee80211_process_callback() use in drivers Message-ID: <CAJ-VmokLTJk3csJwdsZunvY8UDOhiOHQMpf3gvbfxSW3Yxsx4Q@mail.gmail.com> In-Reply-To: <CAFZ_MYKJzLE9t78KJVNS4W3wqLzm1cUuLAtzrQQxkL3y88MGKA@mail.gmail.com> References: <CAFZ_MYJGv8zhJLaAjs_o2mxjjopYofSoymgwfMnO-79nKub66w@mail.gmail.com> <CAJ-VmomS%2Bo%2BvJTjCC26FoXHf6JESDofLgZH4vZRSRKNM3ZgVkQ@mail.gmail.com> <CAFZ_MYLPnH=wMF1uiLCV08LnQztPBA-OkQ8zVKSvp7ZHm%2BvJ1Q@mail.gmail.com> <CAJ-Vmonw=4K4wNo64zU5UDgWkp4zc9P2v90sY1F1ZYWDfaCTsg@mail.gmail.com> <CAFZ_MYKJzLE9t78KJVNS4W3wqLzm1cUuLAtzrQQxkL3y88MGKA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 19 August 2011 12:20, PseudoCylon <moonlightakkiy@yahoo.ca> wrote: >> Hm, so we can't kill the free, because ieee80211_ref_node() is called early on. >> So if ic->ic_raw_xmit(), just return ret, rather then "goto bad" ? >> > > Other mgmt frame Tx functions, i.e ieee80211_send_mgmt(), refs node > and expects ic_raw_xmit() to free node whether on success or on > failure. So, drivers free node after calling > ieee80211_process_callback() or in ic_raw_xmit() on failure. So, ref > count is kept balanced. > > But, ieee80211_send_bar() frees node. So that, on failure in > ic_raw_xmit(), drivers need first to test if it is a BAR frame. If > not, free node; if so, don't free node because ieee80211_send_bar() > does by its self. Otherwise node would be freed twice on one ref. Right. So I'll fix that function to just not free the node once ic->ic_raw_xmit is called. Adrian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmokLTJk3csJwdsZunvY8UDOhiOHQMpf3gvbfxSW3Yxsx4Q>