aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <[email protected]>2012-12-14 01:03:03 +0000
committerDavid S. Miller <[email protected]>2012-12-14 13:14:07 -0500
commit1e9f954516ee03251e0ac2e98cad2e4be6ce9958 (patch)
tree883f6df1483f8d48dd1ad18f62a06e0d52099df1
parentcfb6f99dd9629ec7759b78cff51d9bf7eedf105a (diff)
mac802154: fix destructon ordering for ieee802154 devices
mutex_destroy() must be called before wpan_phy_free(), because it puts the last reference and frees memory. Catched as overwritten poison in kmalloc-2048. Signed-off-by: Konstantin Khlebnikov <[email protected]> Cc: Alexander Smirnov <[email protected]> Cc: Dmitry Eremin-Solenikov <[email protected]> Cc: David S. Miller <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--net/mac802154/ieee802154_dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac802154/ieee802154_dev.c b/net/mac802154/ieee802154_dev.c
index e748aed290aa..b7c7f815deae 100644
--- a/net/mac802154/ieee802154_dev.c
+++ b/net/mac802154/ieee802154_dev.c
@@ -224,9 +224,9 @@ void ieee802154_free_device(struct ieee802154_dev *hw)
BUG_ON(!list_empty(&priv->slaves));
- wpan_phy_free(priv->phy);
-
mutex_destroy(&priv->slaves_mtx);
+
+ wpan_phy_free(priv->phy);
}
EXPORT_SYMBOL(ieee802154_free_device);