Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341699
b: refs/heads/master
c: e41faed
h: refs/heads/master
i:
  341697: 4b23d73
  341695: c9b3ac8
v: v3
  • Loading branch information
Krzysztof Mazur authored and David Woodhouse committed Nov 28, 2012
1 parent c06782c commit 6ca2af3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 3b1a914595f3f9beb9e38ff3ddc7bdafa092ba22
refs/heads/master: e41faed9cde1acce657f75a0b19a1787e9850d3f
9 changes: 7 additions & 2 deletions trunk/net/atm/pppoatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct pppoatm_vcc {
struct atm_vcc *atmvcc; /* VCC descriptor */
void (*old_push)(struct atm_vcc *, struct sk_buff *);
void (*old_pop)(struct atm_vcc *, struct sk_buff *);
struct module *old_owner;
/* keep old push/pop for detaching */
enum pppoatm_encaps encaps;
atomic_t inflight;
Expand Down Expand Up @@ -155,8 +156,6 @@ static void pppoatm_unassign_vcc(struct atm_vcc *atmvcc)
ppp_unregister_channel(&pvcc->chan);
atmvcc->user_back = NULL;
kfree(pvcc);
/* Gee, I hope we have the big kernel lock here... */
module_put(THIS_MODULE);
}

/* Called when an AAL5 PDU comes in */
Expand All @@ -165,9 +164,13 @@ static void pppoatm_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
struct pppoatm_vcc *pvcc = atmvcc_to_pvcc(atmvcc);
pr_debug("\n");
if (skb == NULL) { /* VCC was closed */
struct module *module;

pr_debug("removing ATMPPP VCC %p\n", pvcc);
module = pvcc->old_owner;
pppoatm_unassign_vcc(atmvcc);
atmvcc->push(atmvcc, NULL); /* Pass along bad news */
module_put(module);
return;
}
atm_return(atmvcc, skb->truesize);
Expand Down Expand Up @@ -362,6 +365,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
atomic_set(&pvcc->inflight, NONE_INFLIGHT);
pvcc->old_push = atmvcc->push;
pvcc->old_pop = atmvcc->pop;
pvcc->old_owner = atmvcc->owner;
pvcc->encaps = (enum pppoatm_encaps) be.encaps;
pvcc->chan.private = pvcc;
pvcc->chan.ops = &pppoatm_ops;
Expand All @@ -378,6 +382,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
atmvcc->push = pppoatm_push;
atmvcc->pop = pppoatm_pop;
__module_get(THIS_MODULE);
atmvcc->owner = THIS_MODULE;

/* re-process everything received between connection setup and
backend setup */
Expand Down

0 comments on commit 6ca2af3

Please sign in to comment.