diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2010-01-16 04:04:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-16 04:04:04 -0500 |
commit | d00c362f1b0ff54161e0a42b4554ac621a9ef92d (patch) | |
tree | 33ffeef90727309ad67690b2b7b63e1161b052ec /net/rose/rose_link.c | |
parent | 2a04cd4c7d41c4549764734dcf5a883d304e3229 (diff) |
ax25: netrom: rose: Fix timer oopses
Wrong ax25_cb refcounting in ax25_send_frame() and by its callers can
cause timer oopses (first reported with 2.6.29.6 kernel).
Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=14905
Reported-by: Bernard Pidoux <bpidoux@free.fr>
Tested-by: Bernard Pidoux <bpidoux@free.fr>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rose/rose_link.c')
-rw-r--r-- | net/rose/rose_link.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/rose/rose_link.c b/net/rose/rose_link.c index bd86a63960ce..5ef5f6988a2e 100644 --- a/net/rose/rose_link.c +++ b/net/rose/rose_link.c | |||
@@ -101,13 +101,17 @@ static void rose_t0timer_expiry(unsigned long param) | |||
101 | static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh) | 101 | static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh) |
102 | { | 102 | { |
103 | ax25_address *rose_call; | 103 | ax25_address *rose_call; |
104 | ax25_cb *ax25s; | ||
104 | 105 | ||
105 | if (ax25cmp(&rose_callsign, &null_ax25_address) == 0) | 106 | if (ax25cmp(&rose_callsign, &null_ax25_address) == 0) |
106 | rose_call = (ax25_address *)neigh->dev->dev_addr; | 107 | rose_call = (ax25_address *)neigh->dev->dev_addr; |
107 | else | 108 | else |
108 | rose_call = &rose_callsign; | 109 | rose_call = &rose_callsign; |
109 | 110 | ||
111 | ax25s = neigh->ax25; | ||
110 | neigh->ax25 = ax25_send_frame(skb, 260, rose_call, &neigh->callsign, neigh->digipeat, neigh->dev); | 112 | neigh->ax25 = ax25_send_frame(skb, 260, rose_call, &neigh->callsign, neigh->digipeat, neigh->dev); |
113 | if (ax25s) | ||
114 | ax25_cb_put(ax25s); | ||
111 | 115 | ||
112 | return (neigh->ax25 != NULL); | 116 | return (neigh->ax25 != NULL); |
113 | } | 117 | } |
@@ -120,13 +124,17 @@ static int rose_send_frame(struct sk_buff *skb, struct rose_neigh *neigh) | |||
120 | static int rose_link_up(struct rose_neigh *neigh) | 124 | static int rose_link_up(struct rose_neigh *neigh) |
121 | { | 125 | { |
122 | ax25_address *rose_call; | 126 | ax25_address *rose_call; |
127 | ax25_cb *ax25s; | ||
123 | 128 | ||
124 | if (ax25cmp(&rose_callsign, &null_ax25_address) == 0) | 129 | if (ax25cmp(&rose_callsign, &null_ax25_address) == 0) |
125 | rose_call = (ax25_address *)neigh->dev->dev_addr; | 130 | rose_call = (ax25_address *)neigh->dev->dev_addr; |
126 | else | 131 | else |
127 | rose_call = &rose_callsign; | 132 | rose_call = &rose_callsign; |
128 | 133 | ||
134 | ax25s = neigh->ax25; | ||
129 | neigh->ax25 = ax25_find_cb(rose_call, &neigh->callsign, neigh->digipeat, neigh->dev); | 135 | neigh->ax25 = ax25_find_cb(rose_call, &neigh->callsign, neigh->digipeat, neigh->dev); |
136 | if (ax25s) | ||
137 | ax25_cb_put(ax25s); | ||
130 | 138 | ||
131 | return (neigh->ax25 != NULL); | 139 | return (neigh->ax25 != NULL); |
132 | } | 140 | } |