summaryrefslogtreecommitdiffstats
path: root/net/llc/af_llc.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-12-23 08:41:14 +0100
committerGrant Likely <grant.likely@secretlab.ca>2010-12-23 08:41:14 +0100
commitcfb13c5db08c90311a5defdde9a0328ee788cca5 (patch)
tree842cb60d1d19b99e550fdbc653723e4b13e51ee5 /net/llc/af_llc.c
parentof/net: Move of_get_mac_address() to a common source file. (diff)
parentLinux 2.6.37-rc7 (diff)
downloadlinux-cfb13c5db08c90311a5defdde9a0328ee788cca5.tar.xz
linux-cfb13c5db08c90311a5defdde9a0328ee788cca5.zip
Merge commit 'v2.6.37-rc7' into devicetree/next
Diffstat (limited to 'net/llc/af_llc.c')
-rw-r--r--net/llc/af_llc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 582612998211..e35dbe55f520 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -317,8 +317,9 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
goto out;
rc = -ENODEV;
rtnl_lock();
+ rcu_read_lock();
if (sk->sk_bound_dev_if) {
- llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if);
+ llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if);
if (llc->dev) {
if (!addr->sllc_arphrd)
addr->sllc_arphrd = llc->dev->type;
@@ -329,13 +330,13 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen)
!llc_mac_match(addr->sllc_mac,
llc->dev->dev_addr)) {
rc = -EINVAL;
- dev_put(llc->dev);
llc->dev = NULL;
}
}
} else
llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd,
addr->sllc_mac);
+ rcu_read_unlock();
rtnl_unlock();
if (!llc->dev)
goto out;