diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-05-22 17:43:51 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-05-23 17:57:07 +0200 |
commit | 4a669f7d72535017dd03cbcdf5af6e85edfdf90c (patch) | |
tree | 4ce362a71937e70c0824c96ca85b1e6200586033 | |
parent | 2d8cbd31dd5d4fe7825e1ab88f39c283849db946 (diff) |
mac802154: fix hold rtnl while ioctl
This patch fixes an issue to set address configuration with ioctl.
Accessing the mib requires rtnl lock and the ndo_do_ioctl doesn't hold
the rtnl lock while this callback is called. This patch do that
manually.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reported-by: Matteo Petracca <matteo.petracca@sssup.it>
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/mac802154/iface.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 91b75abbd1a1..2a5878889289 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -62,8 +62,7 @@ mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) (struct sockaddr_ieee802154 *)&ifr->ifr_addr; int err = -ENOIOCTLCMD; - ASSERT_RTNL(); - + rtnl_lock(); spin_lock_bh(&sdata->mib_lock); switch (cmd) { @@ -90,6 +89,7 @@ mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) case SIOCSIFADDR: if (netif_running(dev)) { spin_unlock_bh(&sdata->mib_lock); + rtnl_unlock(); return -EBUSY; } @@ -112,6 +112,7 @@ mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } spin_unlock_bh(&sdata->mib_lock); + rtnl_unlock(); return err; } |