summaryrefslogtreecommitdiff
path: root/rust/alloc/collections/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorJiasheng Jiang <jiashengjiangcool@gmail.com>2026-01-07 19:06:22 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-14 15:58:13 +0100
commitda0faa257f10da39052ca7f1cfa35179ca8749e5 (patch)
tree3029cc1aeca23d3256a32383c61617958ca09a7f /rust/alloc/collections/git@git.tavy.me:linux.git
parent56a512a9b4107079f68701e7d55da8507eb963d9 (diff)
usb: gadget: f_tcm: initialize data_len in UAS path for consistency
In usbg_submit_command(), which handles the UAS protocol, the 'data_len' member of the 'usbg_cmd' structure was left uninitialized by the logic, relying instead on the zeroing performed by usbg_get_cmd(). In contrast, the BOT path (bot_submit_command) explicitly initializes this field from the Command Block Wrapper (CBW). This discrepancy is evident in error handling paths where __target_init_cmd() is called using cmd->data_len. Explicitly initialize cmd->data_len to 0 in the UAS path and use this variable when calling target_submit_cmd(). This ensures architectural consistency between the UAS and BOT protocols within the driver and avoids reliance on implicit memory state during error transitions. Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com> Link: https://patch.msgid.link/20260107190622.26070-1-jiashengjiangcool@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/alloc/collections/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions