diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-06-24 00:06:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-24 00:06:56 -0400 |
commit | 9b200b02a6c9cddca5132d64aa41156bbcddcbaa (patch) | |
tree | 4e326c4fbe9b502c621149cd384b8a9a98642b8e /drivers/net/slip.c | |
parent | d675c989ed2d4ba23dff615330b04371aea83534 (diff) |
[SLIP]: Simplify sl_free_bufs()
We can avoid assignments to the local variable 'tmp' and
actually get rid of tmp alltogether in sl_free_bufs(). This patch does
that. This is safe since both kfree() and slhc_free() handles NULL
pointers gracefully.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/slip.c')
-rw-r--r-- | drivers/net/slip.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 19112712daf0..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 | ||