[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>
This commit is contained in:
parent
18900829f3
commit
158a0e45b6
1 changed files with 12 additions and 18 deletions
|
@ -185,15 +185,12 @@ sl_alloc_bufs(struct slip *sl, int mtu)
|
||||||
/* Cleanup */
|
/* Cleanup */
|
||||||
err_exit:
|
err_exit:
|
||||||
#ifdef SL_INCLUDE_CSLIP
|
#ifdef SL_INCLUDE_CSLIP
|
||||||
if (cbuff)
|
kfree(cbuff);
|
||||||
kfree(cbuff);
|
|
||||||
if (slcomp)
|
if (slcomp)
|
||||||
slhc_free(slcomp);
|
slhc_free(slcomp);
|
||||||
#endif
|
#endif
|
||||||
if (xbuff)
|
kfree(xbuff);
|
||||||
kfree(xbuff);
|
kfree(rbuff);
|
||||||
if (rbuff)
|
|
||||||
kfree(rbuff);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,13 +201,13 @@ sl_free_bufs(struct slip *sl)
|
||||||
void * tmp;
|
void * tmp;
|
||||||
|
|
||||||
/* Free all SLIP frame buffers. */
|
/* Free all SLIP frame buffers. */
|
||||||
if ((tmp = xchg(&sl->rbuff, NULL)) != NULL)
|
tmp = xchg(&sl->rbuff, NULL);
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
if ((tmp = xchg(&sl->xbuff, NULL)) != NULL)
|
tmp = xchg(&sl->xbuff, NULL);
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
#ifdef SL_INCLUDE_CSLIP
|
#ifdef SL_INCLUDE_CSLIP
|
||||||
if ((tmp = xchg(&sl->cbuff, NULL)) != NULL)
|
tmp = xchg(&sl->cbuff, NULL);
|
||||||
kfree(tmp);
|
kfree(tmp);
|
||||||
if ((tmp = xchg(&sl->slcomp, NULL)) != NULL)
|
if ((tmp = xchg(&sl->slcomp, NULL)) != NULL)
|
||||||
slhc_free(tmp);
|
slhc_free(tmp);
|
||||||
#endif
|
#endif
|
||||||
|
@ -297,13 +294,10 @@ static int sl_realloc_bufs(struct slip *sl, int mtu)
|
||||||
spin_unlock_bh(&sl->lock);
|
spin_unlock_bh(&sl->lock);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (xbuff)
|
kfree(xbuff);
|
||||||
kfree(xbuff);
|
kfree(rbuff);
|
||||||
if (rbuff)
|
|
||||||
kfree(rbuff);
|
|
||||||
#ifdef SL_INCLUDE_CSLIP
|
#ifdef SL_INCLUDE_CSLIP
|
||||||
if (cbuff)
|
kfree(cbuff);
|
||||||
kfree(cbuff);
|
|
||||||
#endif
|
#endif
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue