Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179784
b: refs/heads/master
c: d00c362
h: refs/heads/master
v: v3
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Jan 16, 2010
1 parent 84d0c2a commit 11d4576
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 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: 2a04cd4c7d41c4549764734dcf5a883d304e3229
refs/heads/master: d00c362f1b0ff54161e0a42b4554ac621a9ef92d
2 changes: 2 additions & 0 deletions trunk/include/net/netrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ static __inline__ void nr_node_put(struct nr_node *nr_node)
static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh)
{
if (atomic_dec_and_test(&nr_neigh->refcount)) {
if (nr_neigh->ax25)
ax25_cb_put(nr_neigh->ax25);
kfree(nr_neigh->digipeat);
kfree(nr_neigh);
}
Expand Down
6 changes: 6 additions & 0 deletions trunk/net/ax25/ax25_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, ax25_address *src, ax2
#endif
}

/*
* There is one ref for the state machine; a caller needs
* one more to put it back, just like with the existing one.
*/
ax25_cb_hold(ax25);

ax25_cb_add(ax25);

ax25->state = AX25_STATE_1;
Expand Down
11 changes: 6 additions & 5 deletions trunk/net/netrom/nr_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,12 +843,13 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
dptr = skb_push(skb, 1);
*dptr = AX25_P_NETROM;

ax25s = ax25_send_frame(skb, 256, (ax25_address *)dev->dev_addr, &nr_neigh->callsign, nr_neigh->digipeat, nr_neigh->dev);
if (nr_neigh->ax25 && ax25s) {
/* We were already holding this ax25_cb */
ax25s = nr_neigh->ax25;
nr_neigh->ax25 = ax25_send_frame(skb, 256,
(ax25_address *)dev->dev_addr,
&nr_neigh->callsign,
nr_neigh->digipeat, nr_neigh->dev);
if (ax25s)
ax25_cb_put(ax25s);
}
nr_neigh->ax25 = ax25s;

dev_put(dev);
ret = (nr_neigh->ax25 != NULL);
Expand Down
8 changes: 8 additions & 0 deletions trunk/net/rose/rose_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,17 @@ static void rose_t0timer_expiry(unsigned long param)
static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh)
{
ax25_address *rose_call;
ax25_cb *ax25s;

if (ax25cmp(&rose_callsign, &null_ax25_address) == 0)
rose_call = (ax25_address *)neigh->dev->dev_addr;
else
rose_call = &rose_callsign;

ax25s = neigh->ax25;
neigh->ax25 = ax25_send_frame(skb, 260, rose_call, &neigh->callsign, neigh->digipeat, neigh->dev);
if (ax25s)
ax25_cb_put(ax25s);

return (neigh->ax25 != NULL);
}
Expand All @@ -120,13 +124,17 @@ static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh)
static int rose_link_up(struct rose_neigh *neigh)
{
ax25_address *rose_call;
ax25_cb *ax25s;

if (ax25cmp(&rose_callsign, &null_ax25_address) == 0)
rose_call = (ax25_address *)neigh->dev->dev_addr;
else
rose_call = &rose_callsign;

ax25s = neigh->ax25;
neigh->ax25 = ax25_find_cb(rose_call, &neigh->callsign, neigh->digipeat, neigh->dev);
if (ax25s)
ax25_cb_put(ax25s);

return (neigh->ax25 != NULL);
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/net/rose/rose_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)

if ((s = rose_neigh_list) == rose_neigh) {
rose_neigh_list = rose_neigh->next;
if (rose_neigh->ax25)
ax25_cb_put(rose_neigh->ax25);
kfree(rose_neigh->digipeat);
kfree(rose_neigh);
return;
Expand All @@ -243,6 +245,8 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
while (s != NULL && s->next != NULL) {
if (s->next == rose_neigh) {
s->next = rose_neigh->next;
if (rose_neigh->ax25)
ax25_cb_put(rose_neigh->ax25);
kfree(rose_neigh->digipeat);
kfree(rose_neigh);
return;
Expand Down Expand Up @@ -812,6 +816,7 @@ void rose_link_failed(ax25_cb *ax25, int reason)

if (rose_neigh != NULL) {
rose_neigh->ax25 = NULL;
ax25_cb_put(ax25);

rose_del_route_by_neigh(rose_neigh);
rose_kill_by_neigh(rose_neigh);
Expand Down

0 comments on commit 11d4576

Please sign in to comment.