diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c index ca1f04e4a2d9eb3b2a6d6cc5b299aee28d569b08..21df483fda1bc97f69b37b904a1d5ca8e304f9db 100644 --- a/net/phonet/pn_netlink.c +++ b/net/phonet/pn_netlink.c @@ -261,21 +261,15 @@ static int route_doit(struct sk_buff *skb, struct nlmsghdr *nlh, ifindex = nla_get_u32(tb[RTA_OIF]); - rcu_read_lock(); - - dev = dev_get_by_index_rcu(net, ifindex); - if (!dev) { - rcu_read_unlock(); + dev = dev_get_by_index(net, ifindex); + if (!dev) return -ENODEV; - } if (nlh->nlmsg_type == RTM_NEWROUTE) err = phonet_route_add(dev, dst); else err = phonet_route_del(dev, dst); - rcu_read_unlock(); - if (!err) rtm_phonet_notify(net, nlh->nlmsg_type, ifindex, dst);