]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
Bluetooth: btnxpuart: No need to check the received bootloader signature
authorNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Mon, 3 Apr 2023 12:24:30 +0000 (17:54 +0530)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 24 Apr 2023 05:01:59 +0000 (22:01 -0700)
commit305d6b6e485e46a7a3e85d5bfecda9af2294f423
tree1394cad305be237a54e2f1837f1dde6527f335df
parent893410b221f4966890e5bc33be08d38d4bc968b2
Bluetooth: btnxpuart: No need to check the received bootloader signature

We can never assume the uart will deliver a complete packet to the BT
layer at once, the expected packet may be divided into several parts by
uart as uart doesn't know the received packet size, the received data
count may mismatch with the expected packet size, so here
is_valid_bootloader_signature() check may always return false.

Even we remove the count check in is_valid_bootloader_signature(), then
the first part of the data which includes the packet type can pass the
is_valid_bootloader_signature() check, but the remaining parts don't
have the packet type data still cannot pass the check, here return
directly will cause the data loss.

So need to remove the received bootloader signature check here, the
h4_recv_buf() can help us combine the different data received into one
packet. If any out-of-sync or incomplete bootloader signature is received,
it is safe to ignore and discard it, and process the next bootloader
signature.

Co-developed-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btnxpuart.c