]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: Do not free net device after it is unregistered.
authorPavel Emelyanov <xemul@openvz.org>
Mon, 5 May 2008 00:59:30 +0000 (17:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 May 2008 00:59:30 +0000 (17:59 -0700)
commit0beffb3081295a69c257dbdfa3036932d5e0da8b
treeef9c696d9d73f34f75c3470c0a1997964b2256eb
parentb880fd4adf62256a4e6a53a30fb425fe9cba0036
mac80211: Do not free net device after it is unregistered.

The error path in ieee80211_register_hw() may call the unregister_netdev()
and right after it - the free_netdev(), which is wrong, since the
unregister releases the device itself.

So the proposed fix is to NULL the local->mdev after unregister is done
and check this before calling free_netdev().

I checked - no code uses the local->mdev after unregister in this error
path (but even if some did this would be a BUG).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mac80211/main.c