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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1383400074-30555-9-git-send-email-govindarajulu90@gmail.com>
Date:	Sat,  2 Nov 2013 19:17:49 +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 08/13] driver: isdn: 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/isdn/gigaset/ser-gigaset.c | 3 +--
 drivers/isdn/hisax/hfc_usb.c       | 6 ++----
 drivers/isdn/hisax/icc.c           | 6 ++----
 drivers/isdn/hisax/ipacx.c         | 6 ++----
 drivers/isdn/hisax/isac.c          | 6 ++----
 drivers/isdn/hisax/st5481_b.c      | 6 ++----
 drivers/isdn/hisax/w6692.c         | 6 ++----
 7 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index 8c91fd5..9128526 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -221,8 +221,7 @@ static void flush_send_queue(struct cardstate *cs)
 	spin_unlock_irqrestore(&cs->cmdlock, flags);
 
 	/* data queue */
-	if (cs->bcs->tx_skb)
-		dev_kfree_skb_any(cs->bcs->tx_skb);
+	dev_kfree_skb_any(cs->bcs->tx_skb);
 	while ((skb = skb_dequeue(&cs->bcs->squeue)) != NULL)
 		dev_kfree_skb_any(skb);
 }
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 849a807..a1f8380 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -864,10 +864,8 @@ rx_int_complete(struct urb *urb)
 		    fifon, urb->status);
 
 		fifo->urb->interval = 0;	/* cancel automatic rescheduling */
-		if (fifo->skbuff) {
-			dev_kfree_skb_any(fifo->skbuff);
-			fifo->skbuff = NULL;
-		}
+		dev_kfree_skb_any(fifo->skbuff);
+		fifo->skbuff = NULL;
 		return;
 	}
 	len = urb->actual_length;
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index 51dae91..2c52996 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -549,10 +549,8 @@ ICC_l1hw(struct PStack *st, int pr, void *arg)
 	case (HW_DEACTIVATE | RESPONSE):
 		skb_queue_purge(&cs->rq);
 		skb_queue_purge(&cs->sq);
-		if (cs->tx_skb) {
-			dev_kfree_skb_any(cs->tx_skb);
-			cs->tx_skb = NULL;
-		}
+		dev_kfree_skb_any(cs->tx_skb);
+		cs->tx_skb = NULL;
 		if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags))
 			del_timer(&cs->dbusytimer);
 		if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags))
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index 5faa5de..55192a4 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -181,10 +181,8 @@ dch_l2l1(struct PStack *st, int pr, void *arg)
 	case (HW_DEACTIVATE | RESPONSE):
 		skb_queue_purge(&cs->rq);
 		skb_queue_purge(&cs->sq);
-		if (cs->tx_skb) {
-			dev_kfree_skb_any(cs->tx_skb);
-			cs->tx_skb = NULL;
-		}
+		dev_kfree_skb_any(cs->tx_skb);
+		cs->tx_skb = NULL;
 		if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags))
 			del_timer(&cs->dbusytimer);
 		break;
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index 7fdf78f..d0895f2 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -547,10 +547,8 @@ ISAC_l1hw(struct PStack *st, int pr, void *arg)
 	case (HW_DEACTIVATE | RESPONSE):
 		skb_queue_purge(&cs->rq);
 		skb_queue_purge(&cs->sq);
-		if (cs->tx_skb) {
-			dev_kfree_skb_any(cs->tx_skb);
-			cs->tx_skb = NULL;
-		}
+		dev_kfree_skb_any(cs->tx_skb);
+		cs->tx_skb = NULL;
 		if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags))
 			del_timer(&cs->dbusytimer);
 		if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags))
diff --git a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c
index 4098491..b753aca 100644
--- a/drivers/isdn/hisax/st5481_b.c
+++ b/drivers/isdn/hisax/st5481_b.c
@@ -254,10 +254,8 @@ static void st5481B_mode(struct st5481_bcs *bcs, int mode)
 		} else {
 			st5481_usb_device_ctrl_msg(adapter, GPIO_OUT, adapter->leds, NULL, NULL);
 		}
-		if (b_out->tx_skb) {
-			dev_kfree_skb_any(b_out->tx_skb);
-			b_out->tx_skb = NULL;
-		}
+		dev_kfree_skb_any(b_out->tx_skb);
+		b_out->tx_skb = NULL;
 
 	}
 }
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index a858955..dd1fbf4 100644
--- a/drivers/isdn/hisax/w6692.c
+++ b/drivers/isdn/hisax/w6692.c
@@ -653,10 +653,8 @@ W6692_l1hw(struct PStack *st, int pr, void *arg)
 	case (HW_DEACTIVATE | RESPONSE):
 		skb_queue_purge(&cs->rq);
 		skb_queue_purge(&cs->sq);
-		if (cs->tx_skb) {
-			dev_kfree_skb_any(cs->tx_skb);
-			cs->tx_skb = NULL;
-		}
+		dev_kfree_skb_any(cs->tx_skb);
+		cs->tx_skb = NULL;
 		if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags))
 			del_timer(&cs->dbusytimer);
 		if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags))
-- 
1.8.4.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