linux/drivers/bluetooth
Adam Lee d9c78e9738 Bluetooth: fix wrong use of PTR_ERR() in btusb
PTR_ERR() returns a signed long type value which is limited by IS_ERR(),
it must be a negative number whose range is [-MAX_ERRNO, 0).

The bug here returns negative numbers as error codes, then check it by
"if (ret < 0)", but -PTR_ERR() is actually positive. The wrong use here
leads to failure as below, even panic.

[   12.958920] Bluetooth: hci0 command 0xfc8e tx timeout
[   14.961765] Bluetooth: hci0 command 0xfc8e tx timeout
[   16.964688] Bluetooth: hci0 command 0xfc8e tx timeout
[   20.954501] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   22.957358] Bluetooth: hci0 command 0xfc8e tx timeout
[   30.948922] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   32.951780] Bluetooth: hci0 command 0xfc8e tx timeout
[   40.943359] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   42.946219] Bluetooth: hci0 command 0xfc8e tx timeout
[   50.937812] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   52.940670] Bluetooth: hci0 command 0xfc8e tx timeout
[   60.932236] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   62.935092] Bluetooth: hci0 command 0xfc8e tx timeout
[   70.926688] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   72.929545] Bluetooth: hci0 command 0xfc8e tx timeout
[   80.921111] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
[   82.923969] Bluetooth: hci0 command 0xfc2f tx timeout
[   90.915542] Bluetooth: hci0 sending Intel patch command (0xfc2f) failed (-110)
[   92.918406] Bluetooth: hci0 command 0xfc11 tx timeout
[  100.909955] Bluetooth: hci0 sending Intel patch command (0xfc11) failed (-110)
[  102.912858] Bluetooth: hci0 command 0xfc60 tx timeout
[  110.904394] Bluetooth: hci0 sending Intel patch command (0xfc60) failed (-110)
[  112.907293] Bluetooth: hci0 command 0xfc11 tx timeout
[  120.898831] Bluetooth: hci0 exiting Intel manufacturer mode failed (-110)
[  120.904757] bluetoothd[1030]: segfault at 4 ip 00007f8b2eb55236 sp 00007fff53ff6920 error 4 in bluetoothd[7f8b2eaff000+cb000]

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
2013-07-25 19:52:33 +01:00
..
ath3k.c Bluetooth: ath3k: don't use stack memory for DMA 2013-07-25 19:52:32 +01:00
bcm203x.c Bluetooth: Use devm_kzalloc in bcm203x.c file. 2012-08-06 15:03:00 -03:00
bfusb.c Bluetooth: Use devm_kzalloc in bfusb.c file 2012-08-06 15:03:00 -03:00
bluecard_cs.c drivers/bluetooth: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
bpa10x.c Bluetooth: Use devm_kzalloc in bpa10x.c file 2012-08-06 15:03:01 -03:00
bt3c_cs.c drivers/bluetooth: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
btmrvl_debugfs.c Bluetooth: btmrvl: use native helpers for debugfs 2013-04-23 20:44:26 -03:00
btmrvl_drv.h Bluetooth: btmrvl: Do not send vendor events to bluetooth stack 2012-06-19 00:19:11 -03:00
btmrvl_main.c Bluetooth: btmrvl: fix thread stopping race 2013-06-13 13:05:40 -04:00
btmrvl_sdio.c Bluetooth: btmrvl: support Marvell Bluetooth device SD8897 2013-06-12 10:20:54 -04:00
btmrvl_sdio.h Bluetooth: btmrvl: support Marvell Bluetooth device SD8787 2011-04-13 12:20:05 -03:00
btsdio.c Bluetooth: Use devm_kzalloc in btsdio.c file 2012-08-06 15:03:01 -03:00
btuart_cs.c drivers/bluetooth: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
btusb.c Bluetooth: fix wrong use of PTR_ERR() in btusb 2013-07-25 19:52:33 +01:00
btwilink.c Bluetooth: Use module_platform_driver() in btwilink.c file 2012-09-08 16:53:47 -03:00
dtl1_cs.c drivers/bluetooth: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:26:04 -07:00
hci_ath.c tty: move the termios object into the tty 2012-07-16 13:00:41 -07:00
hci_bcsp.c Bluetooth: Remove 'register' usage from the subsystem 2012-06-05 06:34:07 +03:00
hci_h4.c Bluetooth: Fix H4 crash from incoming UART packets 2013-04-04 12:35:58 +03:00
hci_h5.c Bluetooth: Introduce a flags variable to Three-wire UART state 2012-07-17 14:49:24 -03:00
hci_ldisc.c Bluetooth: Remove trivial white space 2013-04-04 12:36:02 +03:00
hci_ll.c Bluetooth: hci_ll.c: removes unnecessary semicolon 2012-09-18 22:26:33 -03:00
hci_uart.h Bluetooth: Add delayed init sequence support for UART controllers 2012-07-17 14:48:29 -03:00
hci_vhci.c Bluetooth: hci_vhci.c: removes unnecessary semicolon 2012-09-18 22:26:43 -03:00
Kconfig Bluetooth: btmrvl: support Marvell Bluetooth device SD8897 2013-06-12 10:20:54 -04:00
Makefile Bluetooth: Initial skeleton for Three-wire UART (H5) support 2012-07-17 14:33:20 -03:00