fakelb: fix schedule while atomic
authorAlexander Aring <aar@pengutronix.de>
Thu, 1 Sep 2016 09:24:57 +0000 (11:24 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Mar 2017 01:57:15 +0000 (09:57 +0800)
commit77fec8bc7a0fbee3bf5893d8c1ce755c029f2b40
tree1405f7c20fda8e0a2026415ddc20681d2386a7ba
parentbb5b96344ed378a1d5b8cf3bd149bb86919f3b9f
fakelb: fix schedule while atomic

commit bdca1fd9a6df745857e23c6056494b7fe062b4e6 upstream.

This patch changes the spinlock to mutex for the available fakelb phy
list. When holding the spinlock the ieee802154_unregister_hw is called
which holding the rtnl_mutex, in that case we get a "BUG: sleeping function
called from invalid context" error. We simple change the spinlock to
mutex which allows to hold the rtnl lock there.

Signed-off-by: Alexander Aring <aar@pengutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ieee802154/fakelb.c