ieee802154 socket: No need to check for ARPHRD_IEEE802154 in raw_bind().
authorLennert Buytenhek <buytenh@wantstofly.org>
Mon, 25 May 2015 12:38:45 +0000 (15:38 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 26 May 2015 18:26:10 +0000 (20:26 +0200)
ieee802154_get_dev() only returns devices that have dev->type ==
ARPHRD_IEEE802154, therefore, there is no need to check this again
in raw_bind().

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/ieee802154/socket.c

index d9fc5ccb1d0d26abaf4eb0217cca4c772f8b5781..02abef2c162187ad12be3f4e7d61fcca803883f8 100644 (file)
@@ -226,15 +226,9 @@ static int raw_bind(struct sock *sk, struct sockaddr *_uaddr, int len)
                goto out;
        }
 
-       if (dev->type != ARPHRD_IEEE802154) {
-               err = -ENODEV;
-               goto out_put;
-       }
-
        sk->sk_bound_dev_if = dev->ifindex;
        sk_dst_reset(sk);
 
-out_put:
        dev_put(dev);
 out:
        release_sock(sk);