Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1269541 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2015-11-14 23:00 +0100 |
| Last post | 2015-11-14 23:00 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH] NFC-nci: Delete unnecessary checks before the function call "kfree_skb" SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-14 23:00 +0100
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2015-11-14 23:00 +0100 |
| Subject | [PATCH] NFC-nci: Delete unnecessary checks before the function call "kfree_skb" |
| Message-ID | <quR1w-10o-5@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Sat, 14 Nov 2015 22:42:48 +0100 The kfree_skb() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- net/nfc/nci/uart.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c index 21d8875..106ecc1 100644 --- a/net/nfc/nci/uart.c +++ b/net/nfc/nci/uart.c @@ -199,11 +199,8 @@ static void nci_uart_tty_close(struct tty_struct *tty) if (!nu) return; - if (nu->tx_skb) - kfree_skb(nu->tx_skb); - if (nu->rx_skb) - kfree_skb(nu->rx_skb); - + kfree_skb(nu->tx_skb); + kfree_skb(nu->rx_skb); skb_queue_purge(&nu->tx_q); nu->ops.close(nu); -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web