Skip to contentSkip to conversation

Bluetooth: Remove pointless check of hci_send_frame parameter

PATCH Applied Marcel Holtmann 2 participants 2 messages Oct 10, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Remove pointless check of hci_send_frame parameter

The hdev parameter of hci_send_frame must be always valid. If the hdev is not valid, it would not even make it to this stage. The callers will have already accessed hdev at that point many times.

---
 net/bluetooth/hci_core.c | 5 -----
 1 file changed, 5 deletions(-)
net/bluetooth/hci_core.c +0 -5
index 925bd47..47cf3a9 100644
@@ -2699,11 +2699,6 @@ EXPORT_SYMBOL(hci_unregister_cb);
 
 static int hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
 {
-	if (!hdev) {
-		kfree_skb(skb);
-		return -ENODEV;
-	}
-
 	BT_DBG("%s type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
 
 	/* Time stamp */
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Marcel,

Quoted 8 lines · Marcel Holtmann

The hdev parameter of hci_send_frame must be always valid. If the hdev is not valid, it would not even make it to this stage. The callers will have already accessed hdev at that point many times.

---
 net/bluetooth/hci_core.c | 5 -----
 1 file changed, 5 deletions(-)

Applied to bluetooth-next. Thanks.

Johan