Skip to content

Commit

Permalink
Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
Browse files Browse the repository at this point in the history
skb allocated by __hci_cmd_sync would not be used whether in checking
for supported iBT hardware variants or after, we should free it in all
error branches, this patch makes the case read version failed or default
error case free skb before return.

Fixes: c86c728 ("Bluetooth: btintel: Fix the legacy bootloader returns tlv based version")
Fixes: 019a1ca ("Bluetooth: btintel: Refactoring setup routine for bootloader devices")
Signed-off-by: Wang ShaoBo <[email protected]>
Reviewed-by: Tedd Ho-Jeong An <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
  • Loading branch information
Wang ShaoBo authored and Vudentz committed Dec 12, 2022
1 parent 50757a2 commit cee50ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/bluetooth/btintel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2524,7 +2524,7 @@ static int btintel_setup_combined(struct hci_dev *hdev)
*/
err = btintel_read_version(hdev, &ver);
if (err)
return err;
break;

/* Apply the device specific HCI quirks
*
Expand Down Expand Up @@ -2566,7 +2566,8 @@ static int btintel_setup_combined(struct hci_dev *hdev)
default:
bt_dev_err(hdev, "Unsupported Intel hw variant (%u)",
INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
return -EINVAL;
err = -EINVAL;
break;
}

exit_error:
Expand Down

0 comments on commit cee50ce

Please sign in to comment.