From: Sebastian Reichel Date: Sat, 15 Apr 2017 21:54:13 +0000 (+0200) Subject: Bluetooth: hci_ll: Fix NULL pointer deref on FW upload failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f2edd9f67b8bdbe8cc3bc5c0ba4992e511147642;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Marcel Holtmann --- 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;