diff options
| author | David S. Miller <davem@nuts.ninka.net> | 2003-04-27 06:06:48 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2003-04-27 06:06:48 -0700 |
| commit | 6677bbb720f7b8f6fdfe16566237594d14bcf5fd (patch) | |
| tree | 5dbc12cbfbc21633aabf233ec18143ef0c028be9 | |
| parent | 33372d545003c7ce73ec5686bd8df3426ff9818b (diff) | |
| parent | 5b8e9042b921a9f87359a8f678c6e32dd868d600 (diff) | |
Merge bk://kernel.bkbits.net/acme/net-2.5
into nuts.ninka.net:/home/davem/src/BK/net-2.5
| -rw-r--r-- | net/unix/af_unix.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 45a143c520da..5d1b4f45942e 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -47,6 +47,9 @@ * Alexey Kuznetsov : Full scale SMP. Lot of bugs are introduced 8) * Malcolm Beattie : Set peercred for socketpair * Michal Ostrowski : Module initialization cleanup. + * Arnaldo C. Melo : Remove MOD_{INC,DEC}_USE_COUNT, + * the core infrastructure is doing that + * for all net proto families now (2.5.69+) * * * Known differences from reference BSD that was tested: @@ -360,7 +363,6 @@ static void unix_sock_destructor(struct sock *sk) #ifdef UNIX_REFCNT_DEBUG printk(KERN_DEBUG "UNIX %p is destroyed, %d are still alive.\n", sk, atomic_read(&unix_nr_socks)); #endif - MOD_DEC_USE_COUNT; } static int unix_release_sock (unix_socket *sk, int embrion) @@ -478,19 +480,16 @@ extern struct proto_ops unix_dgram_ops; static struct sock * unix_create1(struct socket *sock) { - struct sock *sk; + struct sock *sk = NULL; struct unix_sock *u; if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files) - return NULL; + goto out; - MOD_INC_USE_COUNT; sk = sk_alloc(PF_UNIX, GFP_KERNEL, sizeof(struct unix_sock), unix_sk_cachep); - if (!sk) { - MOD_DEC_USE_COUNT; - return NULL; - } + if (!sk) + goto out; atomic_inc(&unix_nr_socks); @@ -509,7 +508,7 @@ static struct sock * unix_create1(struct socket *sock) init_MUTEX(&u->readsem); /* single task reading lock */ init_waitqueue_head(&u->peer_wait); unix_insert_socket(&unix_sockets_unbound, sk); - +out: return sk; } @@ -1928,6 +1927,7 @@ struct proto_ops unix_dgram_ops = { struct net_proto_family unix_family_ops = { .family = PF_UNIX, .create = unix_create, + .owner = THIS_MODULE, }; #ifdef CONFIG_SYSCTL |
