Skip to content

Commit

Permalink
mac802154: fix destructon ordering for ieee802154 devices
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
koct9i authored and davem330 committed Dec 14, 2012
1 parent cfb6f99 commit 1e9f954
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/mac802154/ieee802154_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1e9f954

Please sign in to comment.