summaryrefslogtreecommitdiff
path: root/drivers/net/slip.c
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-04-25 05:59:30 +0400
committerDavid S. Miller <davem@davemloft.net>2005-04-25 05:59:30 +0400
commit158a0e45b69254a9ee4d7795e3b98d8c959fb799 (patch)
tree56b25f7470ff6196abd9493dffa563b5e6206cab /drivers/net/slip.c
parent18900829f32443658ca4d4793c01621c75d551c1 (diff)
downloadlinux-158a0e45b69254a9ee4d7795e3b98d8c959fb799.tar.xz
[SLIP]: Remove redundant NULL pointer checks prior to kfree
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.c30
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)
/* Cleanup */
err_exit:
#ifdef SL_INCLUDE_CSLIP
- if (cbuff)
- kfree(cbuff);
+ kfree(cbuff);
if (slcomp)
slhc_free(slcomp);
#endif
- if (xbuff)
- kfree(xbuff);
- if (rbuff)
- kfree(rbuff);
+ kfree(xbuff);
+ kfree(rbuff);
return err;
}
@@ -204,13 +201,13 @@ sl_free_bufs(struct slip *sl)
void * tmp;
/* Free all SLIP frame buffers. */
- if ((tmp = xchg(&sl->rbuff, NULL)) != NULL)
- kfree(tmp);
- if ((tmp = xchg(&sl->xbuff, NULL)) != NULL)
- kfree(tmp);
+ tmp = xchg(&sl->rbuff, NULL);
+ kfree(tmp);
+ tmp = xchg(&sl->xbuff, NULL);
+ kfree(tmp);
#ifdef SL_INCLUDE_CSLIP
- if ((tmp = xchg(&sl->cbuff, NULL)) != NULL)
- kfree(tmp);
+ tmp = xchg(&sl->cbuff, NULL);
+ kfree(tmp);
if ((tmp = xchg(&sl->slcomp, NULL)) != NULL)
slhc_free(tmp);
#endif
@@ -297,13 +294,10 @@ done_on_bh:
spin_unlock_bh(&sl->lock);
done:
- if (xbuff)
- kfree(xbuff);
- if (rbuff)
- kfree(rbuff);
+ kfree(xbuff);
+ kfree(rbuff);
#ifdef SL_INCLUDE_CSLIP
- if (cbuff)
- kfree(cbuff);
+ kfree(cbuff);
#endif
return err;
}