diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-06-24 06:06:56 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-24 06:06:56 +0200 |
commit | 9b200b02a6c9cddca5132d64aa41156bbcddcbaa (patch) | |
tree | 4e326c4fbe9b502c621149cd384b8a9a98642b8e /drivers | |
parent | [PKT_SCHED]: Packet classification based on textsearch (ematch) (diff) | |
download | linux-9b200b02a6c9cddca5132d64aa41156bbcddcbaa.tar.xz linux-9b200b02a6c9cddca5132d64aa41156bbcddcbaa.zip |
[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')
-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: static void sl_free_bufs(struct slip *sl) { - void * tmp; - /* Free all SLIP frame buffers. */ - tmp = xchg(&sl->rbuff, NULL); - kfree(tmp); - tmp = xchg(&sl->xbuff, NULL); - kfree(tmp); + kfree(xchg(&sl->rbuff, NULL)); + kfree(xchg(&sl->xbuff, NULL)); #ifdef SL_INCLUDE_CSLIP - tmp = xchg(&sl->cbuff, NULL); - kfree(tmp); - if ((tmp = xchg(&sl->slcomp, NULL)) != NULL) - slhc_free(tmp); + kfree(xchg(&sl->cbuff, NULL)); + slhc_free(xchg(&sl->slcomp, NULL)); #endif } |