summaryrefslogtreecommitdiffstats
path: root/net/ieee802154/af_ieee802154.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-08-06 13:18:22 -0700
committerDavid S. Miller <davem@davemloft.net>2009-08-06 13:18:22 -0700
commit0d502d8267ebab9ae4b5b4c065d20196d6069f52 (patch)
tree303f53ec61b4e291a75c9f5617fcef4ed7e55606 /net/ieee802154/af_ieee802154.c
parent09384dfc76e526c3993c09c42e016372dc9dd22c (diff)
parenta9dfac3353b03432e3d46a0dde6795588c46256d (diff)
downloadop-kernel-dev-0d502d8267ebab9ae4b5b4c065d20196d6069f52.zip
op-kernel-dev-0d502d8267ebab9ae4b5b4c065d20196d6069f52.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan
Diffstat (limited to 'net/ieee802154/af_ieee802154.c')
-rw-r--r--net/ieee802154/af_ieee802154.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c
index 3bb6bdb..af66180 100644
--- a/net/ieee802154/af_ieee802154.c
+++ b/net/ieee802154/af_ieee802154.c
@@ -136,7 +136,7 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
unsigned int cmd)
{
struct ifreq ifr;
- int ret = -EINVAL;
+ int ret = -ENOIOCTLCMD;
struct net_device *dev;
if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
@@ -146,8 +146,10 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
dev_load(sock_net(sk), ifr.ifr_name);
dev = dev_get_by_name(sock_net(sk), ifr.ifr_name);
- if (dev->type == ARPHRD_IEEE802154 ||
- dev->type == ARPHRD_IEEE802154_PHY)
+
+ if ((dev->type == ARPHRD_IEEE802154 ||
+ dev->type == ARPHRD_IEEE802154_PHY) &&
+ dev->netdev_ops->ndo_do_ioctl)
ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd);
if (!ret && copy_to_user(arg, &ifr, sizeof(struct ifreq)))
OpenPOWER on IntegriCloud