diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2019-08-21 14:10:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-22 19:22:03 -0400 |
commit | 0f817a5eb9e33cec5baf9dc265bdf240b03cf51b (patch) | |
tree | 356976032586241d3c12d7b1172a1bc0b2a6aeb2 | |
parent | d3ee8ec7de83abf4325c11bcd36cbd01d7a66789 (diff) |
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: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/hardware/mISDN/avmfritz.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/hfcpci.c | 6 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNipac.c | 12 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/mISDNisar.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/netjet.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/mISDN/w6692.c | 9 | ||||
-rw-r--r-- | drivers/isdn/mISDN/l1oip_core.c | 3 | ||||
-rw-r--r-- | drivers/isdn/mISDN/layer2.c | 9 | ||||
-rw-r--r-- | drivers/isdn/mISDN/stack.c | 6 | ||||
-rw-r--r-- | drivers/isdn/mISDN/tei.c | 6 |
10 files changed, 20 insertions, 40 deletions
diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c b/drivers/isdn/hardware/mISDN/avmfritz.c index 81f2b183acc8..1137dd152b5c 100644 --- a/drivers/isdn/hardware/mISDN/avmfritz.c +++ b/drivers/isdn/hardware/mISDN/avmfritz.c | |||
@@ -509,8 +509,7 @@ HDLC_irq_xpr(struct bchannel *bch) | |||
509 | if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) { | 509 | if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) { |
510 | hdlc_fill_fifo(bch); | 510 | hdlc_fill_fifo(bch); |
511 | } else { | 511 | } else { |
512 | if (bch->tx_skb) | 512 | dev_kfree_skb(bch->tx_skb); |
513 | dev_kfree_skb(bch->tx_skb); | ||
514 | if (get_next_bframe(bch)) { | 513 | if (get_next_bframe(bch)) { |
515 | hdlc_fill_fifo(bch); | 514 | hdlc_fill_fifo(bch); |
516 | test_and_clear_bit(FLG_TX_EMPTY, &bch->Flags); | 515 | test_and_clear_bit(FLG_TX_EMPTY, &bch->Flags); |
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index 4a069582fc6b..2330a7d24267 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c | |||
@@ -1119,8 +1119,7 @@ tx_birq(struct bchannel *bch) | |||
1119 | if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) | 1119 | if (bch->tx_skb && bch->tx_idx < bch->tx_skb->len) |
1120 | hfcpci_fill_fifo(bch); | 1120 | hfcpci_fill_fifo(bch); |
1121 | else { | 1121 | else { |
1122 | if (bch->tx_skb) | 1122 | dev_kfree_skb(bch->tx_skb); |
1123 | dev_kfree_skb(bch->tx_skb); | ||
1124 | if (get_next_bframe(bch)) | 1123 | if (get_next_bframe(bch)) |
1125 | hfcpci_fill_fifo(bch); | 1124 | hfcpci_fill_fifo(bch); |
1126 | } | 1125 | } |
@@ -1132,8 +1131,7 @@ tx_dirq(struct dchannel *dch) | |||
1132 | if (dch->tx_skb && dch->tx_idx < dch->tx_skb->len) | 1131 | if (dch->tx_skb && dch->tx_idx < dch->tx_skb->len) |
1133 | hfcpci_fill_dfifo(dch->hw); | 1132 | hfcpci_fill_dfifo(dch->hw); |
1134 | else { | 1133 | else { |
1135 | if (dch->tx_skb) | 1134 | dev_kfree_skb(dch->tx_skb); |
1136 | dev_kfree_skb(dch->tx_skb); | ||
1137 | if (get_next_dframe(dch)) | 1135 | if (get_next_dframe(dch)) |
1138 | hfcpci_fill_dfifo(dch->hw); | 1136 | hfcpci_fill_dfifo(dch->hw); |
1139 | } | 1137 | } |
diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index f915399d75ca..bca880213e91 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c | |||
@@ -190,8 +190,7 @@ isac_rme_irq(struct isac_hw *isac) | |||
190 | #endif | 190 | #endif |
191 | } | 191 | } |
192 | WriteISAC(isac, ISAC_CMDR, 0x80); | 192 | WriteISAC(isac, ISAC_CMDR, 0x80); |
193 | if (isac->dch.rx_skb) | 193 | dev_kfree_skb(isac->dch.rx_skb); |
194 | dev_kfree_skb(isac->dch.rx_skb); | ||
195 | isac->dch.rx_skb = NULL; | 194 | isac->dch.rx_skb = NULL; |
196 | } else { | 195 | } else { |
197 | count = ReadISAC(isac, ISAC_RBCL) & 0x1f; | 196 | count = ReadISAC(isac, ISAC_RBCL) & 0x1f; |
@@ -210,8 +209,7 @@ isac_xpr_irq(struct isac_hw *isac) | |||
210 | if (isac->dch.tx_skb && isac->dch.tx_idx < isac->dch.tx_skb->len) { | 209 | if (isac->dch.tx_skb && isac->dch.tx_idx < isac->dch.tx_skb->len) { |
211 | isac_fill_fifo(isac); | 210 | isac_fill_fifo(isac); |
212 | } else { | 211 | } else { |
213 | if (isac->dch.tx_skb) | 212 | dev_kfree_skb(isac->dch.tx_skb); |
214 | dev_kfree_skb(isac->dch.tx_skb); | ||
215 | if (get_next_dframe(&isac->dch)) | 213 | if (get_next_dframe(&isac->dch)) |
216 | isac_fill_fifo(isac); | 214 | isac_fill_fifo(isac); |
217 | } | 215 | } |
@@ -464,8 +462,7 @@ isacsx_rme_irq(struct isac_hw *isac) | |||
464 | isac->dch.err_crc++; | 462 | isac->dch.err_crc++; |
465 | #endif | 463 | #endif |
466 | WriteISAC(isac, ISACX_CMDRD, ISACX_CMDRD_RMC); | 464 | WriteISAC(isac, ISACX_CMDRD, ISACX_CMDRD_RMC); |
467 | if (isac->dch.rx_skb) | 465 | dev_kfree_skb(isac->dch.rx_skb); |
468 | dev_kfree_skb(isac->dch.rx_skb); | ||
469 | isac->dch.rx_skb = NULL; | 466 | isac->dch.rx_skb = NULL; |
470 | } else { | 467 | } else { |
471 | count = ReadISAC(isac, ISACX_RBCLD) & 0x1f; | 468 | count = ReadISAC(isac, ISACX_RBCLD) & 0x1f; |
@@ -1012,8 +1009,7 @@ hscx_xpr(struct hscx_hw *hx) | |||
1012 | if (hx->bch.tx_skb && hx->bch.tx_idx < hx->bch.tx_skb->len) { | 1009 | if (hx->bch.tx_skb && hx->bch.tx_idx < hx->bch.tx_skb->len) { |
1013 | hscx_fill_fifo(hx); | 1010 | hscx_fill_fifo(hx); |
1014 | } else { | 1011 | } else { |
1015 | if (hx->bch.tx_skb) | 1012 | dev_kfree_skb(hx->bch.tx_skb); |
1016 | dev_kfree_skb(hx->bch.tx_skb); | ||
1017 | if (get_next_bframe(&hx->bch)) { | 1013 | if (get_next_bframe(&hx->bch)) { |
1018 | hscx_fill_fifo(hx); | 1014 | hscx_fill_fifo(hx); |
1019 | test_and_clear_bit(FLG_TX_EMPTY, &hx->bch.Flags); | 1015 | test_and_clear_bit(FLG_TX_EMPTY, &hx->bch.Flags); |
diff --git a/drivers/isdn/hardware/mISDN/mISDNisar.c b/drivers/isdn/hardware/mISDN/mISDNisar.c index fd5c52f37802..4a3e748a1c26 100644 --- a/drivers/isdn/hardware/mISDN/mISDNisar.c +++ b/drivers/isdn/hardware/mISDN/mISDNisar.c | |||
@@ -690,8 +690,7 @@ send_next(struct isar_ch *ch) | |||
690 | } | 690 | } |
691 | } | 691 | } |
692 | } | 692 | } |
693 | if (ch->bch.tx_skb) | 693 | dev_kfree_skb(ch->bch.tx_skb); |
694 | dev_kfree_skb(ch->bch.tx_skb); | ||
695 | if (get_next_bframe(&ch->bch)) { | 694 | if (get_next_bframe(&ch->bch)) { |
696 | isar_fill_fifo(ch); | 695 | isar_fill_fifo(ch); |
697 | test_and_clear_bit(FLG_TX_EMPTY, &ch->bch.Flags); | 696 | test_and_clear_bit(FLG_TX_EMPTY, &ch->bch.Flags); |
diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c index 4e30affd1a7c..61caa7e50b9a 100644 --- a/drivers/isdn/hardware/mISDN/netjet.c +++ b/drivers/isdn/hardware/mISDN/netjet.c | |||
@@ -605,8 +605,7 @@ bc_next_frame(struct tiger_ch *bc) | |||
605 | if (bc->bch.tx_skb && bc->bch.tx_idx < bc->bch.tx_skb->len) { | 605 | if (bc->bch.tx_skb && bc->bch.tx_idx < bc->bch.tx_skb->len) { |
606 | fill_dma(bc); | 606 | fill_dma(bc); |
607 | } else { | 607 | } else { |
608 | if (bc->bch.tx_skb) | 608 | dev_kfree_skb(bc->bch.tx_skb); |
609 | dev_kfree_skb(bc->bch.tx_skb); | ||
610 | if (get_next_bframe(&bc->bch)) { | 609 | if (get_next_bframe(&bc->bch)) { |
611 | fill_dma(bc); | 610 | fill_dma(bc); |
612 | test_and_clear_bit(FLG_TX_EMPTY, &bc->bch.Flags); | 611 | test_and_clear_bit(FLG_TX_EMPTY, &bc->bch.Flags); |
diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index 2402608dc98d..bad55fdacd36 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c | |||
@@ -356,8 +356,7 @@ handle_rxD(struct w6692_hw *card) { | |||
356 | card->dch.err_rx++; | 356 | card->dch.err_rx++; |
357 | #endif | 357 | #endif |
358 | } | 358 | } |
359 | if (card->dch.rx_skb) | 359 | dev_kfree_skb(card->dch.rx_skb); |
360 | dev_kfree_skb(card->dch.rx_skb); | ||
361 | card->dch.rx_skb = NULL; | 360 | card->dch.rx_skb = NULL; |
362 | WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST); | 361 | WriteW6692(card, W_D_CMDR, W_D_CMDR_RACK | W_D_CMDR_RRST); |
363 | } else { | 362 | } else { |
@@ -376,8 +375,7 @@ handle_txD(struct w6692_hw *card) { | |||
376 | if (card->dch.tx_skb && card->dch.tx_idx < card->dch.tx_skb->len) { | 375 | if (card->dch.tx_skb && card->dch.tx_idx < card->dch.tx_skb->len) { |
377 | W6692_fill_Dfifo(card); | 376 | W6692_fill_Dfifo(card); |
378 | } else { | 377 | } else { |
379 | if (card->dch.tx_skb) | 378 | dev_kfree_skb(card->dch.tx_skb); |
380 | dev_kfree_skb(card->dch.tx_skb); | ||
381 | if (get_next_dframe(&card->dch)) | 379 | if (get_next_dframe(&card->dch)) |
382 | W6692_fill_Dfifo(card); | 380 | W6692_fill_Dfifo(card); |
383 | } | 381 | } |
@@ -636,8 +634,7 @@ send_next(struct w6692_ch *wch) | |||
636 | if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { | 634 | if (wch->bch.tx_skb && wch->bch.tx_idx < wch->bch.tx_skb->len) { |
637 | W6692_fill_Bfifo(wch); | 635 | W6692_fill_Bfifo(wch); |
638 | } else { | 636 | } else { |
639 | if (wch->bch.tx_skb) | 637 | dev_kfree_skb(wch->bch.tx_skb); |
640 | dev_kfree_skb(wch->bch.tx_skb); | ||
641 | if (get_next_bframe(&wch->bch)) { | 638 | if (get_next_bframe(&wch->bch)) { |
642 | W6692_fill_Bfifo(wch); | 639 | W6692_fill_Bfifo(wch); |
643 | test_and_clear_bit(FLG_TX_EMPTY, &wch->bch.Flags); | 640 | test_and_clear_bit(FLG_TX_EMPTY, &wch->bch.Flags); |
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index 447f241467bd..b57dcb834594 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c | |||
@@ -1254,8 +1254,7 @@ release_card(struct l1oip *hc) | |||
1254 | mISDN_freebchannel(hc->chan[ch].bch); | 1254 | mISDN_freebchannel(hc->chan[ch].bch); |
1255 | kfree(hc->chan[ch].bch); | 1255 | kfree(hc->chan[ch].bch); |
1256 | #ifdef REORDER_DEBUG | 1256 | #ifdef REORDER_DEBUG |
1257 | if (hc->chan[ch].disorder_skb) | 1257 | dev_kfree_skb(hc->chan[ch].disorder_skb); |
1258 | dev_kfree_skb(hc->chan[ch].disorder_skb); | ||
1259 | #endif | 1258 | #endif |
1260 | } | 1259 | } |
1261 | } | 1260 | } |
diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c index 68a481516729..5bf7fcb282c4 100644 --- a/drivers/isdn/mISDN/layer2.c +++ b/drivers/isdn/mISDN/layer2.c | |||
@@ -900,8 +900,7 @@ l2_disconnect(struct FsmInst *fi, int event, void *arg) | |||
900 | send_uframe(l2, NULL, DISC | 0x10, CMD); | 900 | send_uframe(l2, NULL, DISC | 0x10, CMD); |
901 | mISDN_FsmDelTimer(&l2->t203, 1); | 901 | mISDN_FsmDelTimer(&l2->t203, 1); |
902 | restart_t200(l2, 2); | 902 | restart_t200(l2, 2); |
903 | if (skb) | 903 | dev_kfree_skb(skb); |
904 | dev_kfree_skb(skb); | ||
905 | } | 904 | } |
906 | 905 | ||
907 | static void | 906 | static void |
@@ -1722,8 +1721,7 @@ l2_set_own_busy(struct FsmInst *fi, int event, void *arg) | |||
1722 | enquiry_cr(l2, RNR, RSP, 0); | 1721 | enquiry_cr(l2, RNR, RSP, 0); |
1723 | test_and_clear_bit(FLG_ACK_PEND, &l2->flag); | 1722 | test_and_clear_bit(FLG_ACK_PEND, &l2->flag); |
1724 | } | 1723 | } |
1725 | if (skb) | 1724 | dev_kfree_skb(skb); |
1726 | dev_kfree_skb(skb); | ||
1727 | } | 1725 | } |
1728 | 1726 | ||
1729 | static void | 1727 | static void |
@@ -1736,8 +1734,7 @@ l2_clear_own_busy(struct FsmInst *fi, int event, void *arg) | |||
1736 | enquiry_cr(l2, RR, RSP, 0); | 1734 | enquiry_cr(l2, RR, RSP, 0); |
1737 | test_and_clear_bit(FLG_ACK_PEND, &l2->flag); | 1735 | test_and_clear_bit(FLG_ACK_PEND, &l2->flag); |
1738 | } | 1736 | } |
1739 | if (skb) | 1737 | dev_kfree_skb(skb); |
1740 | dev_kfree_skb(skb); | ||
1741 | } | 1738 | } |
1742 | 1739 | ||
1743 | static void | 1740 | static void |
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index fa2237e7bcf8..27aa32914425 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c | |||
@@ -75,8 +75,7 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb) | |||
75 | cskb = NULL; | 75 | cskb = NULL; |
76 | } | 76 | } |
77 | read_unlock(&sl->lock); | 77 | read_unlock(&sl->lock); |
78 | if (cskb) | 78 | dev_kfree_skb(cskb); |
79 | dev_kfree_skb(cskb); | ||
80 | } | 79 | } |
81 | 80 | ||
82 | static void | 81 | static void |
@@ -134,8 +133,7 @@ send_layer2(struct mISDNstack *st, struct sk_buff *skb) | |||
134 | } | 133 | } |
135 | out: | 134 | out: |
136 | mutex_unlock(&st->lmutex); | 135 | mutex_unlock(&st->lmutex); |
137 | if (skb) | 136 | dev_kfree_skb(skb); |
138 | dev_kfree_skb(skb); | ||
139 | } | 137 | } |
140 | 138 | ||
141 | static inline int | 139 | static inline int |
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c index a4fa594e1caf..59d28cb19738 100644 --- a/drivers/isdn/mISDN/tei.c +++ b/drivers/isdn/mISDN/tei.c | |||
@@ -1328,10 +1328,8 @@ mgr_bcast(struct mISDNchannel *ch, struct sk_buff *skb) | |||
1328 | } | 1328 | } |
1329 | out: | 1329 | out: |
1330 | read_unlock_irqrestore(&mgr->lock, flags); | 1330 | read_unlock_irqrestore(&mgr->lock, flags); |
1331 | if (cskb) | 1331 | dev_kfree_skb(cskb); |
1332 | dev_kfree_skb(cskb); | 1332 | dev_kfree_skb(skb); |
1333 | if (skb) | ||
1334 | dev_kfree_skb(skb); | ||
1335 | return 0; | 1333 | return 0; |
1336 | } | 1334 | } |
1337 | 1335 | ||