lkml.org 
[lkml]   [2022]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v2 13/25] 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: cff834c16d23 ("usb-gadget/tcm: Convert to TARGET_SCF_ACK_KREF I/O krefs")
    Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    ---
    Changes in v2:
    - None

    drivers/usb/gadget/function/f_tcm.c | 1 -
    1 file changed, 1 deletion(-)

    diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c
    index 53b178ad4f90..cace5746c0f9 100644
    --- a/drivers/usb/gadget/function/f_tcm.c
    +++ b/drivers/usb/gadget/function/f_tcm.c
    @@ -1045,7 +1045,6 @@ static void usbg_cmd_work(struct work_struct *work)
    out:
    transport_send_check_condition_and_sense(se_cmd,
    TCM_UNSUPPORTED_SCSI_OPCODE, 1);
    - transport_generic_free_cmd(&cmd->se_cmd, 0);
    }

    static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu,
    --
    2.28.0
    \
     
     \ /
      Last update: 2022-07-19 04:13    [W:4.129 / U:23.696 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site