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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  2 Nov 2013 19:17:51 +0530
From:	Govindarajulu Varadarajan <govindarajulu90@...il.com>
To:	davem@...emloft.net, gregkh@...uxfoundation.org,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	schwidefsky@...ibm.com, linville@...driver.com,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	IvDoorn@...il.com, sbhatewara@...are.com, samuel@...tiz.org,
	chas@....nrl.navy.mil, roland@...nel.org, isdn@...ux-pingi.de,
	jcliburn@...il.com, benve@...co.com, ssujith@...co.com,
	jeffrey.t.kirsher@...el.com, jesse.brandeburg@...el.com,
	shahed.shaikh@...gic.com, joe@...ches.com, apw@...onical.com
Cc:	Govindarajulu Varadarajan <govindarajulu90@...il.com>
Subject: [PATCH net-next 10/13] driver: infiniband: remove unnecessary NULL check before dev_kfree_skb_any

dev_kfree_skb_any is protected from NULL. No need to check for NULL
while calling this function.

Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@...il.com>
---
 drivers/infiniband/hw/amso1100/c2.c | 6 ++----
 drivers/infiniband/hw/nes/nes_hw.c  | 3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index d53cf51..30c4d00 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -312,10 +312,8 @@ static inline int c2_tx_free(struct c2_dev *c2dev, struct c2_element *elem)
 	pci_unmap_single(c2dev->pcidev, elem->mapaddr, elem->maplen,
 			 PCI_DMA_TODEVICE);
 
-	if (elem->skb) {
-		dev_kfree_skb_any(elem->skb);
-		elem->skb = NULL;
-	}
+	dev_kfree_skb_any(elem->skb);
+	elem->skb = NULL;
 
 	return 0;
 }
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 9020024..2275a8e 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2856,8 +2856,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
 							break;
 					}
 				}
-				if (skb)
-					dev_kfree_skb_any(skb);
+				dev_kfree_skb_any(skb);
 				nesnic->sq_tail++;
 				nesnic->sq_tail &= nesnic->sq_size-1;
 				if (sq_cqes > 128) {
-- 
1.8.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists