Skip to content

Commit 1690721

Browse files
Thinh Nguyengregkh
Thinh Nguyen
authored andcommitted
usb: gadget: f_tcm: Don't free command immediately
commit c225d00 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: cff834c ("usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs") Cc: [email protected] Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/ae919ac431f16275e05ec819bdffb3ac5f44cbe1.1733876548.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent cd3bbcb commit 1690721

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/usb/gadget/function/f_tcm.c

-2
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,6 @@ static void usbg_cmd_work(struct work_struct *work)
10661066
out:
10671067
transport_send_check_condition_and_sense(se_cmd,
10681068
TCM_UNSUPPORTED_SCSI_OPCODE, 1);
1069-
transport_generic_free_cmd(&cmd->se_cmd, 0);
10701069
}
10711070

10721071
static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
@@ -1195,7 +1194,6 @@ static void bot_cmd_work(struct work_struct *work)
11951194
out:
11961195
transport_send_check_condition_and_sense(se_cmd,
11971196
TCM_UNSUPPORTED_SCSI_OPCODE, 1);
1198-
transport_generic_free_cmd(&cmd->se_cmd, 0);
11991197
}
12001198

12011199
static int bot_submit_command(struct f_uas *fu,

0 commit comments

Comments
 (0)