Bluetooth: hci_uart: Fix false success return in hci_uart_setup()

When reading the local version information for vendor detection
fails, the error is only printed and 0 is returned, which masks the
setup failure from the HCI core.

Return PTR_ERR(skb) instead.

Fixes: fb2ce8d11f ("Bluetooth: hci_uart: Add support for vendor detection flag")
Fixes: 82f5169bf3 ("Bluetooth: hci_uart: add serdev driver support library")
Cc: stable@vger.kernel.org
Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Gongwei Li 2026-08-21 10:45:55 +08:00 committed by Luiz Augusto von Dentz
parent 44c98fd082
commit a935579934
2 changed files with 2 additions and 2 deletions

View File

@ -457,7 +457,7 @@ static int hci_uart_setup(struct hci_dev *hdev)
if (IS_ERR(skb)) {
BT_ERR("%s: Reading local version information failed (%ld)",
hdev->name, PTR_ERR(skb));
return 0;
return PTR_ERR(skb);
}
if (skb->len != sizeof(*ver)) {

View File

@ -221,7 +221,7 @@ static int hci_uart_setup(struct hci_dev *hdev)
if (IS_ERR(skb)) {
bt_dev_err(hdev, "Reading local version info failed (%ld)",
PTR_ERR(skb));
return 0;
return PTR_ERR(skb);
}
if (skb->len != sizeof(*ver))