Skip to content

Commit

Permalink
isdn: remove some pointless conditionals before kfree_skb()
Browse files Browse the repository at this point in the history
Remove some pointless conditionals before kfree_skb().

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Feb 27, 2009
1 parent e44578e commit d46604e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/isdn/capi/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static void capiminor_free(struct capiminor *mp)
list_del(&mp->list);
write_unlock_irqrestore(&capiminor_list_lock, flags);

if (mp->ttyskb) kfree_skb(mp->ttyskb);
kfree_skb(mp->ttyskb);
mp->ttyskb = NULL;
skb_queue_purge(&mp->inqueue);
skb_queue_purge(&mp->outqueue);
Expand Down
6 changes: 2 additions & 4 deletions drivers/isdn/pcbit/layer2.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ pcbit_receive(struct pcbit_dev *dev)
if (dev->read_frame) {
printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n");
/* discard previous queued frame */
if (dev->read_frame->skb)
kfree_skb(dev->read_frame->skb);
kfree_skb(dev->read_frame->skb);
kfree(dev->read_frame);
dev->read_frame = NULL;
}
Expand Down Expand Up @@ -601,8 +600,7 @@ pcbit_l2_err_recover(unsigned long data)
dev->w_busy = dev->r_busy = 1;

if (dev->read_frame) {
if (dev->read_frame->skb)
kfree_skb(dev->read_frame->skb);
kfree_skb(dev->read_frame->skb);
kfree(dev->read_frame);
dev->read_frame = NULL;
}
Expand Down

0 comments on commit d46604e

Please sign in to comment.