diff options
author | Thinh Nguyen <Thinh.Nguyen@synopsys.com> | 2024-12-11 03:31:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-24 10:56:06 +0300 |
commit | 3b2a52e88ab0c9469eaadd4d4c8f57d072477820 (patch) | |
tree | bee4ff6a4513dd4630524edf4bb1a92ec1dc41f4 /drivers/usb/gadget | |
parent | 98fa00fd3ae43b857b4976984a135483d89d9281 (diff) | |
download | linux-3b2a52e88ab0c9469eaadd4d4c8f57d072477820.tar.xz |
usb: gadget: f_tcm: Decrement command ref count on cleanup
We submitted the command with TARGET_SCF_ACK_KREF, which requires
acknowledgment of command completion. If the command fails, make sure to
decrement the ref count.
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/3c667b4d9c8b0b580346a69ff53616b6a74cfea2.1733876548.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_tcm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 88b8b94fdb1e..5ce97723376e 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -969,6 +969,7 @@ static void usbg_data_write_cmpl(struct usb_ep *ep, struct usb_request *req) return; cleanup: + target_put_sess_cmd(se_cmd); transport_generic_free_cmd(&cmd->se_cmd, 0); } |