Commit 0f817a5e authored by Markus Elfring's avatar Markus Elfring Committed by David S. Miller

mISDN: Delete unnecessary checks before the macro call “dev_kfree_skb”

The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the shown calls is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3ee8ec7
...@@ -509,7 +509,6 @@ HDLC_irq_xpr(struct bchannel *bch) ...@@ -509,7 +509,6 @@ HDLC_irq_xpr(struct bchannel *bch)
if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) { if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) {
hdlc_fill_fifo(bch); hdlc_fill_fifo(bch);
} else { } else {
if (bch->tx_skb)
dev_kfree_skb(bch->tx_skb); dev_kfree_skb(bch->tx_skb);
if (get_next_bframe(bch)) { if (get_next_bframe(bch)) {
hdlc_fill_fifo(bch); hdlc_fill_fifo(bch);
......
...@@ -1119,7 +1119,6 @@ tx_birq(struct bchannel *bch) ...@@ -1119,7 +1119,6 @@ tx_birq(struct bchannel *bch)
if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len)
hfcpci_fill_fifo(bch); hfcpci_fill_fifo(bch);
else { else {
if (bch->tx_skb)
dev_kfree_skb(bch->tx_skb); dev_kfree_skb(bch->tx_skb);
if (get_next_bframe(bch)) if (get_next_bframe(bch))
hfcpci_fill_fifo(bch); hfcpci_fill_fifo(bch);
...@@ -1132,7 +1131,6 @@ tx_dirq(struct dchannel *dch) ...@@ -1132,7 +1131,6 @@ tx_dirq(struct dchannel *dch)
if (dch->tx_skb && dch->tx_idx < dch->tx_skb->len) if (dch->tx_skb && dch->tx_idx < dch->tx_skb->len)
hfcpci_fill_dfifo(dch->hw); hfcpci_fill_dfifo(dch->hw);
else { else {
if (dch->tx_skb)
dev_kfree_skb(dch->tx_skb); dev_kfree_skb(dch->tx_skb);
if (get_next_dframe(dch)) if (get_next_dframe(dch))
hfcpci_fill_dfifo(dch->hw); hfcpci_fill_dfifo(dch->hw);
......
...@@ -190,7 +190,6 @@ isac_rme_irq(struct isac_hw *isac) ...@@ -190,7 +190,6 @@ isac_rme_irq(struct isac_hw *isac)
#endif #endif
} }
WriteISAC(isac, ISAC_CMDR, 0x80); WriteISAC(isac, ISAC_CMDR, 0x80);
if (isac->dch.rx_skb)
dev_kfree_skb(isac->dch.rx_skb); dev_kfree_skb(isac->dch.rx_skb);
isac->dch.rx_skb = NULL; isac->dch.rx_skb = NULL;
} else { } else {
...@@ -210,7 +209,6 @@ isac_xpr_irq(struct isac_hw *isac) ...@@ -210,7 +209,6 @@ isac_xpr_irq(struct isac_hw *isac)
if (isac->dch.tx_skb && isac->dch.tx_idx < isac->dch.tx_skb->len) { if (isac->dch.tx_skb && isac->dch.tx_idx < isac->dch.tx_skb->len) {
isac_fill_fifo(isac); isac_fill_fifo(isac);
} else { } else {
if (isac->dch.tx_skb)
dev_kfree_skb(isac->dch.tx_skb); dev_kfree_skb(isac->dch.tx_skb);
if (get_next_dframe(&isac->dch)) if (get_next_dframe(&isac->dch))
isac_fill_fifo(isac); isac_fill_fifo(isac);
...@@ -464,7 +462,6 @@ isacsx_rme_irq(struct isac_hw *isac) ...@@ -464,7 +462,6 @@ isacsx_rme_irq(struct isac_hw *isac)
isac->dch.err_crc++; isac->dch.err_crc++;
#endif #endif
WriteISAC(isac, ISACX_CMDRD, ISACX_CMDRD_RMC); WriteISAC(isac, ISACX_CMDRD, ISACX_CMDRD_RMC);
if (isac->dch.rx_skb)
dev_kfree_skb(isac->dch.rx_skb); dev_kfree_skb(isac->dch.rx_skb);
isac->dch.rx_skb = NULL; isac->dch.rx_skb = NULL;
} else { } else {
...@@ -1012,7 +1009,6 @@ hscx_xpr(struct hscx_hw *hx) ...@@ -1012,7 +1009,6 @@ hscx_xpr(struct hscx_hw *hx)
if (hx->bch.tx_skb && hx->bch.tx_idx < hx->bch.tx_skb->len) { if (hx->bch.tx_skb && hx->bch.tx_idx < hx->bch.tx_skb->len) {
hscx_fill_fifo(hx); hscx_fill_fifo(hx);
} else { } else {
if (hx->bch.tx_skb)
dev_kfree_skb(hx->bch.tx_skb); dev_kfree_skb(hx->bch.tx_skb);
if (get_next_bframe(&hx->bch)) { if (get_next_bframe(&hx->bch)) {
hscx_fill_fifo(hx); hscx_fill_fifo(hx);
......
...@@ -690,7 +690,6 @@ send_next(struct isar_ch *ch) ...@@ -690,7 +690,6 @@ send_next(struct isar_ch *ch)
} }
} }
} }
if (ch->bch.tx_skb)
dev_kfree_skb(ch->bch.tx_skb); dev_kfree_skb(ch->bch.tx_skb);
if (get_next_bframe(&ch->bch)) { if (get_next_bframe(&ch->bch)) {
isar_fill_fifo(ch); isar_fill_fifo(ch);
......
...@@ -605,7 +605,6 @@ bc_next_frame(struct tiger_ch *bc) ...@@ -605,7 +605,6 @@ bc_next_frame(struct tiger_ch *bc)
if (bc->bch.tx_skb && bc->bch.tx_idx < bc->bch.tx_skb->len) { if (bc->bch.tx_skb && bc->bch.tx_idx < bc->bch.tx_skb->len) {
fill_dma(bc); fill_dma(bc);
} else { } else {
if (bc->bch.tx_skb)
dev_kfree_skb(bc->bch.tx_skb); dev_kfree_skb(bc->bch.tx_skb);
if (get_next_bframe(&bc->bch)) { if (get_next_bframe(&bc->bch)) {
fill_dma(bc); fill_dma(bc);
......
...@@ -356,7 +356,6 @@ handle_rxD(struct w6692_hw *card) { ...@@ -356,7 +356,6 @@ handle_rxD(struct w6692_hw *card) {
card->dch.err_rx++; card->dch.err_rx++;
#endif #endif
} }
if (card->dch.rx_skb)
dev_kfree_skb(card->dch.rx_skb); dev_kfree_skb(card->dch.rx_skb);
card->dch.rx_skb = NULL; card->dch.rx_skb = NULL;
WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST); WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST);
...@@ -376,7 +375,6 @@ handle_txD(struct w6692_hw *card) { ...@@ -376,7 +375,6 @@ handle_txD(struct w6692_hw *card) {
if (card->dch.tx_skb && card->dch.tx_idx < card->dch.tx_skb->len) { if (card->dch.tx_skb && card->dch.tx_idx < card->dch.tx_skb->len) {
W6692_fill_Dfifo(card); W6692_fill_Dfifo(card);
} else { } else {
if (card->dch.tx_skb)
dev_kfree_skb(card->dch.tx_skb); dev_kfree_skb(card->dch.tx_skb);
if (get_next_dframe(&card->dch)) if (get_next_dframe(&card->dch))
W6692_fill_Dfifo(card); W6692_fill_Dfifo(card);
...@@ -636,7 +634,6 @@ send_next(struct w6692_ch *wch) ...@@ -636,7 +634,6 @@ send_next(struct w6692_ch *wch)
if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) {
W6692_fill_Bfifo(wch); W6692_fill_Bfifo(wch);
} else { } else {
if (wch->bch.tx_skb)
dev_kfree_skb(wch->bch.tx_skb); dev_kfree_skb(wch->bch.tx_skb);
if (get_next_bframe(&wch->bch)) { if (get_next_bframe(&wch->bch)) {
W6692_fill_Bfifo(wch); W6692_fill_Bfifo(wch);
......
...@@ -1254,7 +1254,6 @@ release_card(struct l1oip *hc) ...@@ -1254,7 +1254,6 @@ release_card(struct l1oip *hc)
mISDN_freebchannel(hc->chan[ch].bch); mISDN_freebchannel(hc->chan[ch].bch);
kfree(hc->chan[ch].bch); kfree(hc->chan[ch].bch);
#ifdef REORDER_DEBUG #ifdef REORDER_DEBUG
if (hc->chan[ch].disorder_skb)
dev_kfree_skb(hc->chan[ch].disorder_skb); dev_kfree_skb(hc->chan[ch].disorder_skb);
#endif #endif
} }
......
...@@ -900,7 +900,6 @@ l2_disconnect(struct FsmInst *fi, int event, void *arg) ...@@ -900,7 +900,6 @@ l2_disconnect(struct FsmInst *fi, int event, void *arg)
send_uframe(l2, NULL, DISC | 0x10, CMD); send_uframe(l2, NULL, DISC | 0x10, CMD);
mISDN_FsmDelTimer(&l2->t203, 1); mISDN_FsmDelTimer(&l2->t203, 1);
restart_t200(l2, 2); restart_t200(l2, 2);
if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
...@@ -1722,7 +1721,6 @@ l2_set_own_busy(struct FsmInst *fi, int event, void *arg) ...@@ -1722,7 +1721,6 @@ l2_set_own_busy(struct FsmInst *fi, int event, void *arg)
enquiry_cr(l2, RNR, RSP, 0); enquiry_cr(l2, RNR, RSP, 0);
test_and_clear_bit(FLG_ACK_PEND, &l2->flag); test_and_clear_bit(FLG_ACK_PEND, &l2->flag);
} }
if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
...@@ -1736,7 +1734,6 @@ l2_clear_own_busy(struct FsmInst *fi, int event, void *arg) ...@@ -1736,7 +1734,6 @@ l2_clear_own_busy(struct FsmInst *fi, int event, void *arg)
enquiry_cr(l2, RR, RSP, 0); enquiry_cr(l2, RR, RSP, 0);
test_and_clear_bit(FLG_ACK_PEND, &l2->flag); test_and_clear_bit(FLG_ACK_PEND, &l2->flag);
} }
if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
......
...@@ -75,7 +75,6 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb) ...@@ -75,7 +75,6 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb)
cskb = NULL; cskb = NULL;
} }
read_unlock(&sl->lock); read_unlock(&sl->lock);
if (cskb)
dev_kfree_skb(cskb); dev_kfree_skb(cskb);
} }
...@@ -134,7 +133,6 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb) ...@@ -134,7 +133,6 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb)
} }
out: out:
mutex_unlock(&st->lmutex); mutex_unlock(&st->lmutex);
if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
......
...@@ -1328,9 +1328,7 @@ mgr_bcast(struct mISDNchannel *ch, struct sk_buff *skb) ...@@ -1328,9 +1328,7 @@ mgr_bcast(struct mISDNchannel *ch, struct sk_buff *skb)
} }
out: out:
read_unlock_irqrestore(&mgr->lock, flags); read_unlock_irqrestore(&mgr->lock, flags);
if (cskb)
dev_kfree_skb(cskb); dev_kfree_skb(cskb);
if (skb)
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment