[SLIP]: Remove redundant NULL pointer checks prior to kfree
authorJesper Juhl <juhl-lkml@dif.dk>
Mon, 25 Apr 2005 01:59:30 +0000 (18:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2005 01:59:30 +0000 (18:59 -0700)
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/slip.c

index 4ce52f5f241950dec7e7e4b4a19fd71939e0ffc8..8f7841c0374d38d7caaaf7b6003882c83cc1582b 100644 (file)
@@ -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;
 }