Skip to contentSkip to conversation

BUG fix for drivers/bluetooth/hci_usb.c

PATCH In review Vinay K Nallamothu 2 participants 2 messages Aug 9, 2003 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 BUG fix for drivers/bluetooth/hci_usb.c

Hi,

The patch below fixes two pointer reference bugs (shows up as compile time warnings given below) which wrongly take the address of "struct usb_interface*".

============compiler warning============================ drivers/bluetooth/hci_usb.c: In function `hci_usb_probe':
drivers/bluetooth/hci_usb.c:786: warning: assignment from incompatible pointer type
drivers/bluetooth/hci_usb.c:810: warning: assignment from incompatible pointer type
=========================================================================

drivers/bluetooth/hci_usb.c +2 -2
diff -urN linux-2.6.0-test3/drivers/bluetooth/hci_usb.c linux-2.6.0-test3-nvk/drivers/bluetooth/hci_usb.c
@@ -783,7 +783,7 @@
 
 	BT_DBG("udev %p ifnum %d", udev, ifnum);
 
-	iface = &udev->actconfig->interface[0];
+	iface = udev->actconfig->interface[0];
 
 	/* Check our black list */
 	if (usb_match_id(intf, ignore_ids))
@@ -807,7 +807,7 @@
 
 	ifn = min_t(unsigned int, udev->actconfig->desc.bNumInterfaces, HCI_MAX_IFACE_NUM);
 	for (i = 0; i < ifn; i++) {
-		iface = &udev->actconfig->interface[i];
+		iface = udev->actconfig->interface[i];
 		for (a = 0; a < iface->num_altsetting; a++) {
 			uif = &iface->altsetting[a];
 			for (e = 0; e < uif->desc.bNumEndpoints; e++) {
#1 lore raw
Quoted 6 lines · Vinay K Nallamothu

Hi,

The patch below fixes two pointer reference bugs (shows up as compile time warnings given below) which wrongly take the address of "struct usb_interface*".

Quoted 6 lines

============compiler warning============================ drivers/bluetooth/hci_usb.c: In function `hci_usb_probe':
drivers/bluetooth/hci_usb.c:786: warning: assignment from incompatible pointer type
drivers/bluetooth/hci_usb.c:810: warning: assignment from incompatible pointer type

Hey, not only that, the fix also made bluetooth work for me (previously it would just oops when loading hci-usb). Thanks a lot!

Taneli