Skip to contentSkip to conversation

bluetooth-drv: remove some pointless conditionals before kfree_skb()

PATCH In review Wei Yongjun 2 participants 2 messages Feb 25, 2009 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluetooth-drv: remove some pointless conditionals before kfree_skb()

Remove some pointless conditionals before kfree_skb().

---
 drivers/bluetooth/bfusb.c  |    3 +--
 drivers/bluetooth/hci_h4.c |    3 +--
 drivers/bluetooth/hci_ll.c |    3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/bluetooth/bfusb.c +1 -2
index d3f14be..2a00707 100644
@@ -257,8 +257,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
 
 	if (hdr & 0x10) {
 		BT_ERR("%s error in block", data->hdev->name);
-		if (data->reassembly)
-			kfree_skb(data->reassembly);
+		kfree_skb(data->reassembly);
 		data->reassembly = NULL;
 		return -EIO;
 	}
drivers/bluetooth/hci_h4.c +1 -2
index b0fafb0..c0ce813 100644
@@ -102,8 +102,7 @@ static int h4_close(struct hci_uart *hu)
 
 	skb_queue_purge(&h4->txq);
 
-	if (h4->rx_skb)
-		kfree_skb(h4->rx_skb);
+	kfree_skb(h4->rx_skb);
 
 	hu->priv = NULL;
 	kfree(h4);
drivers/bluetooth/hci_ll.c +1 -2
index b91d45a..5c65014 100644
@@ -163,8 +163,7 @@ static int ll_close(struct hci_uart *hu)
 	skb_queue_purge(&ll->tx_wait_q);
 	skb_queue_purge(&ll->txq);
 
-	if (ll->rx_skb)
-		kfree_skb(ll->rx_skb);
+	kfree_skb(ll->rx_skb);
 
 	hu->priv = NULL;
 
Signature · 1 line
1.5.3.8
maintainer
#1 lore raw

Hi Wei,

Quoted 1 line

Remove some pointless conditionals before kfree_skb().

patch has been added to my bluetooth-testing.git tree. Thanks.

Regards

Marcel