All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Enforce providing hdev->send driver callback
@ 2014-07-06 13:50 Marcel Holtmann
  2014-07-06 14:12 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2014-07-06 13:50 UTC (permalink / raw)
  To: linux-bluetooth

The hdev->send driver callback is mandatory to be provided by a driver
before calling hci_register_dev. So enforce it and return EINVAL in
case it is not available.

All existing drivers are providing this callback anyway, so this is
just an extra sanity check.

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

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index b02454ab07ee..623ffe0da4a6 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3932,7 +3932,7 @@ int hci_register_dev(struct hci_dev *hdev)
 {
 	int id, error;
 
-	if (!hdev->open || !hdev->close)
+	if (!hdev->open || !hdev->close || !hdev->send)
 		return -EINVAL;
 
 	/* Do not allow HCI_AMP devices to register at index 0,
-- 
1.9.3


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

* Re: [PATCH] Bluetooth: Enforce providing hdev->send driver callback
  2014-07-06 13:50 [PATCH] Bluetooth: Enforce providing hdev->send driver callback Marcel Holtmann
@ 2014-07-06 14:12 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-07-06 14:12 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Sun, Jul 06, 2014, Marcel Holtmann wrote:
> The hdev->send driver callback is mandatory to be provided by a driver
> before calling hci_register_dev. So enforce it and return EINVAL in
> case it is not available.
> 
> All existing drivers are providing this callback anyway, so this is
> just an extra sanity check.
> 
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  net/bluetooth/hci_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to bluetooth-next. Thanks.

Johan

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

end of thread, other threads:[~2014-07-06 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-06 13:50 [PATCH] Bluetooth: Enforce providing hdev->send driver callback Marcel Holtmann
2014-07-06 14:12 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.