wl1251: fix crash on remove due to premature kfree
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 26 Apr 2012 19:01:30 +0000 (22:01 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 Apr 2012 23:14:04 +0000 (02:14 +0300)
commit1d936922428617c70c405861d0ebc1bd9951644c
tree77fa1de38eba5d3e9742b74360ce362e6761ec42
parentcea9ab1e918e7a610395c36cf2fe2f6241ffa8a7
wl1251: fix crash on remove due to premature kfree

Currently SDIO glue frees it's own structure before calling
wl1251_free_hw(), which in turn calls ieee80211_unregister_hw().
The later call may result in a need to communicate with the chip
to stop it (as it happens now if the interface is still up before
rmmod), which means calls are made back to the glue, resulting in
freed memory access.

Fix this by freeing glue data last.

Cc: stable@vger.kernel.org # v2.6.37+
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
drivers/net/wireless/wl1251/sdio.c