Эх сурвалжийг харах

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>
Marcel Holtmann 11 жил өмнө
parent
commit
74292d5ac2

+ 1 - 1
net/bluetooth/hci_core.c

@@ -3932,7 +3932,7 @@ int hci_register_dev(struct hci_dev *hdev)
 {
 {
 	int id, error;
 	int id, error;
 
 
-	if (!hdev->open || !hdev->close)
+	if (!hdev->open || !hdev->close || !hdev->send)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	/* Do not allow HCI_AMP devices to register at index 0,
 	/* Do not allow HCI_AMP devices to register at index 0,