[PATCH 10/12] mac802154: fix destructon ordering for ieee802154 devices

Subsystems: ieee 802.15.4 subsystem, networking [general], the rest

STALE5047d

2 messages, 2 authors, 2012-12-14 · open the first message on its own page

[PATCH 10/12] mac802154: fix destructon ordering for ieee802154 devices

From: Konstantin Khlebnikov <hidden>
Date: 2012-12-14 11:03:14

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 <redacted>
Cc: Alexander Smirnov <redacted>
Cc: Dmitry Eremin-Solenikov <redacted>
Cc: David S. Miller <davem@davemloft.net>
Cc: linux-zigbee-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org
---
 net/mac802154/ieee802154_dev.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac802154/ieee802154_dev.c b/net/mac802154/ieee802154_dev.c
index e748aed..b7c7f81 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);
 

Re: [PATCH 10/12] mac802154: fix destructon ordering for ieee802154 devices

From: David Miller <davem@davemloft.net>
Date: 2012-12-14 18:16:21

From: Konstantin Khlebnikov <redacted>
Date: Fri, 14 Dec 2012 15:03:03 +0400
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 <redacted>
Applied.

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help