diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-07-06 09:50:27 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-06 10:11:37 -0400 |
commit | 74292d5ac289ff5ec8b565889aaeab332e709099 (patch) | |
tree | a29dd1f047ee57b57c85c438e4573309c9cbf28c | |
parent | cdc52faac5f341beaff036828b9459f7c8dd7296 (diff) |
Bluetooth: Enforce providing hdev->send driver callback
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>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r-- | net/bluetooth/hci_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
3932 | { | 3932 | { |
3933 | int id, error; | 3933 | int id, error; |
3934 | 3934 | ||
3935 | if (!hdev->open || !hdev->close) | 3935 | if (!hdev->open || !hdev->close || !hdev->send) |
3936 | return -EINVAL; | 3936 | return -EINVAL; |
3937 | 3937 | ||
3938 | /* Do not allow HCI_AMP devices to register at index 0, | 3938 | /* Do not allow HCI_AMP devices to register at index 0, |