Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Remove pointless check of hci_send_frame parameter
@ 2013-10-10 20:29 Marcel Holtmann
  2013-10-10 22:21 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2013-10-10 20:29 UTC (permalink / raw)
  To: linux-bluetooth

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.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/hci_core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 925bd47..47cf3a9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -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 */
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Remove pointless check of hci_send_frame parameter
  2013-10-10 20:29 [PATCH] Bluetooth: Remove pointless check of hci_send_frame parameter Marcel Holtmann
@ 2013-10-10 22:21 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2013-10-10 22:21 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Thu, Oct 10, 2013, Marcel Holtmann wrote:
> 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.
> 
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  net/bluetooth/hci_core.c | 5 -----
>  1 file changed, 5 deletions(-)

Applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-10 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 20:29 [PATCH] Bluetooth: Remove pointless check of hci_send_frame parameter Marcel Holtmann
2013-10-10 22:21 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox