Skip to contentSkip to conversation

wan: remove some pointless conditionals before kfree_skb()

PATCH Applied Wei Yongjun 3 participants 3 messages Feb 25, 2009 – Feb 27, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wan: remove some pointless conditionals before kfree_skb()

Remove some pointless conditionals before kfree_skb().

---
 drivers/net/wan/cosa.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/wan/cosa.c +1 -2
index 0d7ba11..d276d72 100644
@@ -731,8 +731,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)
 	 * We can safely fall back to non-dma-able memory, because we have
 	 * the cosa->bouncebuf pre-allocated.
 	 */
-	if (chan->rx_skb)
-		kfree_skb(chan->rx_skb);
+	kfree_skb(chan->rx_skb);
 	chan->rx_skb = dev_alloc_skb(size);
 	if (chan->rx_skb == NULL) {
 		printk(KERN_NOTICE "%s: Memory squeeze, dropping packet\n",
Signature · 1 line
1.5.3.8
Acked-by on v1 1/1
#1 lore raw

Wei Yongjun wrote:
: Remove some pointless conditionals before kfree_skb(). :
: Signed-off-by: Wei Yongjun <[email protected]>

Thanks,

-Yenya

: ---
: drivers/net/wan/cosa.c | 3 +--
: 1 files changed, 1 insertions(+), 2 deletions(-)
:
: diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
: index 0d7ba11..d276d72 100644
: --- a/drivers/net/wan/cosa.c
: +++ b/drivers/net/wan/cosa.c
: @@ -731,8 +731,7 @@ static char *cosa_net_setup_rx(struct channel_data *chan, int size)

:  	 * We can safely fall back to non-dma-able memory, because we have
:  	 * the cosa->bouncebuf pre-allocated.
:  	 */
: -	if (chan->rx_skb)
: -		kfree_skb(chan->rx_skb);
: +	kfree_skb(chan->rx_skb);
:  	chan->rx_skb = dev_alloc_skb(size);
:  	if (chan->rx_skb == NULL) {
:  		printk(KERN_NOTICE "%s: Memory squeeze, dropping packet\n",

: --
: 1.5.3.8
:
:
:

Signature · 3 lines
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
Quoted 2 lines
Quoted 2 lines

If you find yourself arguing with Alan Cox, you’re _probably_ wrong. <<
--James Morris in "How and Why You Should Become a Kernel Hacker" <<