diff options
Diffstat (limited to 'drivers/net/slip.c')
-rw-r--r-- | drivers/net/slip.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 8f7841c0374d..c79e0ad4ba02 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -198,18 +198,12 @@ err_exit: | |||
198 | static void | 198 | static void |
199 | sl_free_bufs(struct slip *sl) | 199 | sl_free_bufs(struct slip *sl) |
200 | { | 200 | { |
201 | void * tmp; | ||
202 | |||
203 | /* Free all SLIP frame buffers. */ | 201 | /* Free all SLIP frame buffers. */ |
204 | tmp = xchg(&sl->rbuff, NULL); | 202 | kfree(xchg(&sl->rbuff, NULL)); |
205 | kfree(tmp); | 203 | kfree(xchg(&sl->xbuff, NULL)); |
206 | tmp = xchg(&sl->xbuff, NULL); | ||
207 | kfree(tmp); | ||
208 | #ifdef SL_INCLUDE_CSLIP | 204 | #ifdef SL_INCLUDE_CSLIP |
209 | tmp = xchg(&sl->cbuff, NULL); | 205 | kfree(xchg(&sl->cbuff, NULL)); |
210 | kfree(tmp); | 206 | slhc_free(xchg(&sl->slcomp, NULL)); |
211 | if ((tmp = xchg(&sl->slcomp, NULL)) != NULL) | ||
212 | slhc_free(tmp); | ||
213 | #endif | 207 | #endif |
214 | } | 208 | } |
215 | 209 | ||
@@ -1430,7 +1424,7 @@ static void __exit slip_exit(void) | |||
1430 | kfree(slip_devs); | 1424 | kfree(slip_devs); |
1431 | slip_devs = NULL; | 1425 | slip_devs = NULL; |
1432 | 1426 | ||
1433 | if ((i = tty_register_ldisc(N_SLIP, NULL))) | 1427 | if ((i = tty_unregister_ldisc(N_SLIP))) |
1434 | { | 1428 | { |
1435 | printk(KERN_ERR "SLIP: can't unregister line discipline (err = %d)\n", i); | 1429 | printk(KERN_ERR "SLIP: can't unregister line discipline (err = %d)\n", i); |
1436 | } | 1430 | } |