lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5647ACA7.3000905@users.sourceforge.net>
Date:	Sat, 14 Nov 2015 22:50:31 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	Aloisio Almeida Jr <aloisio.almeida@...nbossa.org>,
	"David S. Miller" <davem@...emloft.net>,
	Lauro Ramos Venancio <lauro.venancio@...nbossa.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Vincent Cuissard <cuissard@...vell.com>,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org
Cc:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] NFC-nci: Delete unnecessary checks before the function call
 "kfree_skb"

From: Markus Elfring <elfring@...rs.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@...rs.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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ