diff options
Diffstat (limited to 'drivers/net/slip.c')
-rw-r--r-- | drivers/net/slip.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 4ce52f5f2419..8f7841c0374d 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -185,15 +185,12 @@ sl_alloc_bufs(struct slip *sl, int mtu) | |||
185 | /* Cleanup */ | 185 | /* Cleanup */ |
186 | err_exit: | 186 | err_exit: |
187 | #ifdef SL_INCLUDE_CSLIP | 187 | #ifdef SL_INCLUDE_CSLIP |
188 | if (cbuff) | 188 | kfree(cbuff); |
189 | kfree(cbuff); | ||
190 | if (slcomp) | 189 | if (slcomp) |
191 | slhc_free(slcomp); | 190 | slhc_free(slcomp); |
192 | #endif | 191 | #endif |
193 | if (xbuff) | 192 | kfree(xbuff); |
194 | kfree(xbuff); | 193 | kfree(rbuff); |
195 | if (rbuff) | ||
196 | kfree(rbuff); | ||
197 | return err; | 194 | return err; |
198 | } | 195 | } |
199 | 196 | ||
@@ -204,13 +201,13 @@ sl_free_bufs(struct slip *sl) | |||
204 | void * tmp; | 201 | void * tmp; |
205 | 202 | ||
206 | /* Free all SLIP frame buffers. */ | 203 | /* Free all SLIP frame buffers. */ |
207 | if ((tmp = xchg(&sl->rbuff, NULL)) != NULL) | 204 | tmp = xchg(&sl->rbuff, NULL); |
208 | kfree(tmp); | 205 | kfree(tmp); |
209 | if ((tmp = xchg(&sl->xbuff, NULL)) != NULL) | 206 | tmp = xchg(&sl->xbuff, NULL); |
210 | kfree(tmp); | 207 | kfree(tmp); |
211 | #ifdef SL_INCLUDE_CSLIP | 208 | #ifdef SL_INCLUDE_CSLIP |
212 | if ((tmp = xchg(&sl->cbuff, NULL)) != NULL) | 209 | tmp = xchg(&sl->cbuff, NULL); |
213 | kfree(tmp); | 210 | kfree(tmp); |
214 | if ((tmp = xchg(&sl->slcomp, NULL)) != NULL) | 211 | if ((tmp = xchg(&sl->slcomp, NULL)) != NULL) |
215 | slhc_free(tmp); | 212 | slhc_free(tmp); |
216 | #endif | 213 | #endif |
@@ -297,13 +294,10 @@ done_on_bh: | |||
297 | spin_unlock_bh(&sl->lock); | 294 | spin_unlock_bh(&sl->lock); |
298 | 295 | ||
299 | done: | 296 | done: |
300 | if (xbuff) | 297 | kfree(xbuff); |
301 | kfree(xbuff); | 298 | kfree(rbuff); |
302 | if (rbuff) | ||
303 | kfree(rbuff); | ||
304 | #ifdef SL_INCLUDE_CSLIP | 299 | #ifdef SL_INCLUDE_CSLIP |
305 | if (cbuff) | 300 | kfree(cbuff); |
306 | kfree(cbuff); | ||
307 | #endif | 301 | #endif |
308 | return err; | 302 | return err; |
309 | } | 303 | } |