o af_packet: remove MOD_{INC,DEC}_USE_COUNT

Now the core networking infrastructure will (finally) do that for the net
protocol families, its just a matter of setting the ->owner field in the
registered struct net_proto_family to THIS_MODULE.
parent 688e84a2
...@@ -209,7 +209,6 @@ void packet_sock_destruct(struct sock *sk) ...@@ -209,7 +209,6 @@ void packet_sock_destruct(struct sock *sk)
#ifdef PACKET_REFCNT_DEBUG #ifdef PACKET_REFCNT_DEBUG
printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr)); printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr));
#endif #endif
MOD_DEC_USE_COUNT;
} }
...@@ -939,7 +938,6 @@ static int packet_create(struct socket *sock, int protocol) ...@@ -939,7 +938,6 @@ static int packet_create(struct socket *sock, int protocol)
return -ESOCKTNOSUPPORT; return -ESOCKTNOSUPPORT;
sock->state = SS_UNCONNECTED; sock->state = SS_UNCONNECTED;
MOD_INC_USE_COUNT;
err = -ENOBUFS; err = -ENOBUFS;
sk = sk_alloc(PF_PACKET, GFP_KERNEL, 1, NULL); sk = sk_alloc(PF_PACKET, GFP_KERNEL, 1, NULL);
...@@ -992,7 +990,6 @@ static int packet_create(struct socket *sock, int protocol) ...@@ -992,7 +990,6 @@ static int packet_create(struct socket *sock, int protocol)
out_free: out_free:
sk_free(sk); sk_free(sk);
out: out:
MOD_DEC_USE_COUNT;
return err; return err;
} }
...@@ -1752,6 +1749,7 @@ struct proto_ops packet_ops = { ...@@ -1752,6 +1749,7 @@ struct proto_ops packet_ops = {
static struct net_proto_family packet_family_ops = { static struct net_proto_family packet_family_ops = {
.family = PF_PACKET, .family = PF_PACKET,
.create = packet_create, .create = packet_create,
.owner = THIS_MODULE,
}; };
static struct notifier_block packet_netdev_notifier = { static struct notifier_block packet_netdev_notifier = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment