summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>2024-12-11 00:31:48 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 10:05:15 +0100
commit0c3d544b61c670e55599b58f874c8b9d52620268 (patch)
tree21e9842813f5864c322870f1ca20d0a1ec40a751 /drivers
parent5ff4628b8dcf0c62d00f47517b75ce9c456118aa (diff)
downloadlinux-0c3d544b61c670e55599b58f874c8b9d52620268.tar.gz
linux-0c3d544b61c670e55599b58f874c8b9d52620268.tar.bz2
linux-0c3d544b61c670e55599b58f874c8b9d52620268.zip
usb: gadget: f_tcm: Decrement command ref count on cleanup
commit 3b2a52e88ab0c9469eaadd4d4c8f57d072477820 upstream. 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')
-rw-r--r--drivers/usb/gadget/function/f_tcm.c1
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 b5bf707e1f34..94dc8d5a39c8 100644
--- a/drivers/usb/gadget/function/f_tcm.c
+++ b/drivers/usb/gadget/function/f_tcm.c
@@ -973,6 +973,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);
}