diff options
-rw-r--r-- | include/linux/atmdev.h | 1 | ||||
-rw-r--r-- | net/atm/common.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 22ef21c33d0c..72db2af902a8 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -106,6 +106,7 @@ struct atm_vcc { void *dev_data; /* per-device data */ void *proto_data; /* per-protocol data */ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ + struct module *owner; /* owner of ->push function */ /* SVC part --- may move later ------------------------------------- */ short itf; /* interface number */ struct sockaddr_atmsvc local; diff --git a/net/atm/common.c b/net/atm/common.c index 0c0ad930a632..24216642d696 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -156,6 +156,7 @@ int vcc_create(struct net *net, struct socket *sock, int protocol, int family) atomic_set(&sk->sk_rmem_alloc, 0); vcc->push = NULL; vcc->pop = NULL; + vcc->owner = NULL; vcc->push_oam = NULL; vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ vcc->atm_options = vcc->aal_options = 0; @@ -175,6 +176,7 @@ static void vcc_destroy_socket(struct sock *sk) vcc->dev->ops->close(vcc); if (vcc->push) vcc->push(vcc, NULL); /* atmarpd has no push */ + module_put(vcc->owner); while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { atm_return(vcc, skb->truesize); |