From: Lennert Buytenhek Date: Mon, 25 May 2015 12:38:45 +0000 (+0300) Subject: ieee802154 socket: No need to check for ARPHRD_IEEE802154 in raw_bind(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=66a3297f6d3f9dc35e27c3cec6b4437ac13f07ff;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ieee802154 socket: No need to check for ARPHRD_IEEE802154 in raw_bind(). 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 Acked-by: Alexander Aring Signed-off-by: Marcel Holtmann --- diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c index d9fc5ccb1d0d..02abef2c1621 100644 --- a/net/ieee802154/socket.c +++ b/net/ieee802154/socket.c @@ -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);