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: 371805522f ("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>
This commit is contained in:
Sebastian Reichel 2017-04-15 23:54:13 +02:00 committed by Marcel Holtmann
parent fb796707d7
commit f2edd9f67b
1 changed files with 1 additions and 2 deletions

View File

@ -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;