]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rt2x00: Fix SLAB corruption during rmmod
authorGertjan van Wingerde <gwingerde@gmail.com>
Wed, 1 Apr 2009 19:18:11 +0000 (21:18 +0200)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:52 +0000 (10:36 -0700)
commitf8629efabc754f5c0003ce38c28b26db7ca89244
tree8a9f5c9a324841fc802b9722f9cb721b4382c3af
parentc3d82093749274b9f86d9a058372cccb9eed3ac0
rt2x00: Fix SLAB corruption during rmmod

At rmmod stage, the code path is the following one :

rt2x00lib_remove_dev
  ->  rt2x00lib_uninitialize()
        -> rt2x00rfkill_unregister()
             -> rfkill_unregister()
        -> rt2x00rfkill_free()
             -> rfkill_free()

The problem is that rfkill_free should not be called after rfkill_register
otherwise put_device(&rfkill->dev) will be called 2 times. This patch
fixes this by only calling rt2x00rfkill_free() when rt2x00rfkill_register()
hasn't been called or has failed.

This patch is for 2.6.29 only. The code in question has completely disappeared
in 2.6.30 and does not contain this bug.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Tested-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00lib.h
drivers/net/wireless/rt2x00/rt2x00rfkill.c