]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: f_tcm: Don't free command immediately
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Wed, 11 Dec 2024 00:31:36 +0000 (00:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:16 +0000 (12:50 +0100)
commitbbb7f49839b57d66ccaf7b5752d9b63d3031dd0a
tree6867338e21e8c265687894ca24b4a1214f09a705
parent3ba8884a56a3eb97c22f0ce0e4dd410d4ca4c277
usb: gadget: f_tcm: Don't free command immediately

commit c225d006a31949d673e646d585d9569bc28feeb9 upstream.

Don't prematurely free the command. Wait for the status completion of
the sense status. It can be freed then. Otherwise we will double-free
the command.

Fixes: cff834c16d23 ("usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs")
Cc: stable@vger.kernel.org
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/ae919ac431f16275e05ec819bdffb3ac5f44cbe1.1733876548.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_tcm.c