Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105796
b: refs/heads/master
c: 696adfe
h: refs/heads/master
v: v3
  • Loading branch information
Paul E. McKenney authored and Linus Torvalds committed Jul 25, 2008
1 parent 32076a0 commit 66a818f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2fc9c4e18f94431e7eb77d97edb2a995b46fba55
refs/heads/master: 696adfe84c11c571a1e0863460ff0ec142b4e5a9
4 changes: 1 addition & 3 deletions trunk/net/802/psnap.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ static struct llc_sap *snap_sap;
*/
static struct datalink_proto *find_snap_client(unsigned char *desc)
{
struct list_head *entry;
struct datalink_proto *proto = NULL, *p;

list_for_each_rcu(entry, &snap_list) {
p = list_entry(entry, struct datalink_proto, node);
list_for_each_entry_rcu(p, &snap_list, node) {
if (!memcmp(p->type, desc, 5)) {
proto = p;
break;
Expand Down
9 changes: 3 additions & 6 deletions trunk/net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ static inline int inet_netns_ok(struct net *net, int protocol)
static int inet_create(struct net *net, struct socket *sock, int protocol)
{
struct sock *sk;
struct list_head *p;
struct inet_protosw *answer;
struct inet_sock *inet;
struct proto *answer_prot;
Expand All @@ -281,13 +280,12 @@ static int inet_create(struct net *net, struct socket *sock, int protocol)
sock->state = SS_UNCONNECTED;

/* Look for the requested type/protocol pair. */
answer = NULL;
lookup_protocol:
err = -ESOCKTNOSUPPORT;
rcu_read_lock();
list_for_each_rcu(p, &inetsw[sock->type]) {
answer = list_entry(p, struct inet_protosw, list);
list_for_each_entry_rcu(answer, &inetsw[sock->type], list) {

err = 0;
/* Check the non-wild match. */
if (protocol == answer->protocol) {
if (protocol != IPPROTO_IP)
Expand All @@ -302,10 +300,9 @@ static int inet_create(struct net *net, struct socket *sock, int protocol)
break;
}
err = -EPROTONOSUPPORT;
answer = NULL;
}

if (unlikely(answer == NULL)) {
if (unlikely(err)) {
if (try_loading_module < 2) {
rcu_read_unlock();
/*
Expand Down
9 changes: 3 additions & 6 deletions trunk/net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ static int inet6_create(struct net *net, struct socket *sock, int protocol)
struct inet_sock *inet;
struct ipv6_pinfo *np;
struct sock *sk;
struct list_head *p;
struct inet_protosw *answer;
struct proto *answer_prot;
unsigned char answer_flags;
Expand All @@ -97,13 +96,12 @@ static int inet6_create(struct net *net, struct socket *sock, int protocol)
build_ehash_secret();

/* Look for the requested type/protocol pair. */
answer = NULL;
lookup_protocol:
err = -ESOCKTNOSUPPORT;
rcu_read_lock();
list_for_each_rcu(p, &inetsw6[sock->type]) {
answer = list_entry(p, struct inet_protosw, list);
list_for_each_entry_rcu(answer, &inetsw6[sock->type], list) {

err = 0;
/* Check the non-wild match. */
if (protocol == answer->protocol) {
if (protocol != IPPROTO_IP)
Expand All @@ -118,10 +116,9 @@ static int inet6_create(struct net *net, struct socket *sock, int protocol)
break;
}
err = -EPROTONOSUPPORT;
answer = NULL;
}

if (!answer) {
if (err) {
if (try_loading_module < 2) {
rcu_read_unlock();
/*
Expand Down

0 comments on commit 66a818f

Please sign in to comment.