mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 17:41:44 +00:00
[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>
This commit is contained in:
parent
d675c989ed
commit
9b200b02a6
@ -198,18 +198,12 @@ err_exit:
|
|||||||
static void
|
static void
|
||||||
sl_free_bufs(struct slip *sl)
|
sl_free_bufs(struct slip *sl)
|
||||||
{
|
{
|
||||||
void * tmp;
|
|
||||||
|
|
||||||
/* Free all SLIP frame buffers. */
|
/* Free all SLIP frame buffers. */
|
||||||
tmp = xchg(&sl->rbuff, NULL);
|
kfree(xchg(&sl->rbuff, NULL));
|
||||||
kfree(tmp);
|
kfree(xchg(&sl->xbuff, NULL));
|
||||||
tmp = xchg(&sl->xbuff, NULL);
|
|
||||||
kfree(tmp);
|
|
||||||
#ifdef SL_INCLUDE_CSLIP
|
#ifdef SL_INCLUDE_CSLIP
|
||||||
tmp = xchg(&sl->cbuff, NULL);
|
kfree(xchg(&sl->cbuff, NULL));
|
||||||
kfree(tmp);
|
slhc_free(xchg(&sl->slcomp, NULL));
|
||||||
if ((tmp = xchg(&sl->slcomp, NULL)) != NULL)
|
|
||||||
slhc_free(tmp);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user