]> git.hungrycats.org Git - linux/commit
Bluetooth: btmtk: remove extra copy in cmd array init
authorJiajia Liu <liujiajia@kylinos.cn>
Wed, 20 May 2026 02:15:00 +0000 (10:15 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 11 Jun 2026 18:24:39 +0000 (14:24 -0400)
commitddb249341df3779c3c5cbe407b196f39921e1c53
treec8327014f25fbfe70a28d465763882075b30dfbc
parent5269f7231c2b78774c39ae3a27ce2c497cd5aff4
Bluetooth: btmtk: remove extra copy in cmd array init

In btmtk_setup_firmware_79xx, the data length indicated by wmt_params.dlen
in the cmd buffer is MTK_SEC_MAP_NEED_SEND_SIZE + 1. Except for the first
byte, the remaining length is MTK_SEC_MAP_NEED_SEND_SIZE. memcpy copied one
more byte to cmd + 1 than the remaining length. Align the length passed to
memcpy to avoid exceeding current section map.

Signed-off-by: Jiajia Liu <liujiajia@kylinos.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btmtk.c