summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_ll.c
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2017-04-15 23:54:13 +0200
committerMarcel Holtmann <marcel@holtmann.org>2017-04-22 10:28:40 +0200
commitf2edd9f67b8bdbe8cc3bc5c0ba4992e511147642 (patch)
treecc5074c8d7cc0ff668acda681ab15ce4361f0dab /drivers/bluetooth/hci_ll.c
parentfb796707d7a6c9b24fdf80b9b4f24fa5ffcf0ec5 (diff)
downloadblackbird-obmc-linux-f2edd9f67b8bdbe8cc3bc5c0ba4992e511147642.tar.gz
blackbird-obmc-linux-f2edd9f67b8bdbe8cc3bc5c0ba4992e511147642.zip
Bluetooth: hci_ll: Fix NULL pointer deref on FW upload failure
Avoid NULL pointer dereference occurring due to freeing skb containing an error pointer. It can easily be triggered by using the driver with broken uart (i.e. due to misconfigured pinmuxing). Fixes: 371805522f87 ("bluetooth: hci_uart: add LL protocol serdev driver support") Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_ll.c')
-rw-r--r--drivers/bluetooth/hci_ll.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 485e8eb04542..adc444f309a3 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -537,8 +537,7 @@ static int read_local_version(struct hci_dev *hdev)
if (IS_ERR(skb)) {
bt_dev_err(hdev, "Reading TI version information failed (%ld)",
PTR_ERR(skb));
- err = PTR_ERR(skb);
- goto out;
+ return PTR_ERR(skb);
}
if (skb->len != sizeof(*ver)) {
err = -EILSEQ;
OpenPOWER on IntegriCloud