Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2013 11:33:02 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Hans Petter Selasky <hselasky@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r246614 - head/sys/dev/usb/wlan
Message-ID:  <201302111133.02161.jhb@freebsd.org>
In-Reply-To: <201302101036.r1AAaHs1022034@svn.freebsd.org>
References:  <201302101036.r1AAaHs1022034@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, February 10, 2013 5:36:17 am Hans Petter Selasky wrote:
> Author: hselasky
> Date: Sun Feb 10 10:36:16 2013
> New Revision: 246614
> URL: http://svnweb.freebsd.org/changeset/base/246614
> 
> Log:
>   - Streamline detach logic in wlan drivers, so that
>     freed memory cannot be used during detach.
>   - Remove all panic() calls from the urtw driver because
>     panic() is not appropriate here.
>   - Remove redundant checks for device detached in
>     device detach callbacks.
>   - Use DEVMETHOD_END to mark end of device methods.

Using a detached flag to bail from ioctl generally means you are doing things 
wrong in detach.  The correct solution is to always detach your ifnet first, 
then start tearing down other state.  In general with device detach routines 
the first order of business is removing external references such as character 
devices, ifnets, etc. and only start shutting down the hardware and releasing 
state once those steps have completed.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302111133.02161.jhb>