Skip to content

Commit c225d00

Browse files
Thinh Nguyengregkh
Thinh Nguyen
authored andcommitted
usb: gadget: f_tcm: Don't free command immediately
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: cff834c ("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>
1 parent 1aede06 commit c225d00

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/usb/gadget/function/f_tcm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,6 @@ static void usbg_cmd_work(struct work_struct *work)
10621062
out:
10631063
transport_send_check_condition_and_sense(se_cmd,
10641064
TCM_UNSUPPORTED_SCSI_OPCODE, 1);
1065-
transport_generic_free_cmd(&cmd->se_cmd, 0);
10661065
}
10671066

10681067
static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
@@ -1191,7 +1190,6 @@ static void bot_cmd_work(struct work_struct *work)
11911190
out:
11921191
transport_send_check_condition_and_sense(se_cmd,
11931192
TCM_UNSUPPORTED_SCSI_OPCODE, 1);
1194-
transport_generic_free_cmd(&cmd->se_cmd, 0);
11951193
}
11961194

11971195
static int bot_submit_command(struct f_uas *fu,

0 commit comments

Comments
 (0)