Message ID | 73f6f1ed35feba3db337124a860bd2c89817db0e.1657149962.git.Thinh.Nguyen@synopsys.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <target-devel-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C847C43334 for <target-devel@archiver.kernel.org>; Wed, 6 Jul 2022 23:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234622AbiGFXhL (ORCPT <rfc822;target-devel@archiver.kernel.org>); Wed, 6 Jul 2022 19:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234661AbiGFXhH (ORCPT <rfc822;target-devel@vger.kernel.org>); Wed, 6 Jul 2022 19:37:07 -0400 Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 543DD2CDC9; Wed, 6 Jul 2022 16:37:07 -0700 (PDT) Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 24BA54077F; Wed, 6 Jul 2022 23:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1657150627; bh=W3tGsKXgdwRs/twkzD8FF5EhDgkxWHBsOlMoHb/p1PM=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=GArJC/WUl97fb3nWZ0mwuxUzY42cIaWFioeguUU66TtftiEgAWZ4SBUftPInevBP8 din840CmruWWMKRrm67jEnQaBTtAkNh0zWDr5GGDoihyR/C8RmWqd1AEQkF/OUcOsI dhhtUSPZS0/oDuHnKQfSoNcrDJhqf4dUA55I7KsnbSO0iZfsjSMHz0t7Ja4OIfKIH/ 2Pa9Ol7qetZ6GFtsdsGOU3o9WvM/i0euzyEmatxasD/XM7JlJvJz9Vvnqzrk4axrJr XYyr4D15KUac+voU1GFLeUacvHyaaB/1/+y85uIFVhv0s+V5gsthbJB56wG+w7I71g j0jjLacMmtgIQ== Received: from te-lab16-v2 (nanobot.internal.synopsys.com [10.204.48.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id D76F0A006F; Wed, 6 Jul 2022 23:37:04 +0000 (UTC) Received: by te-lab16-v2 (sSMTP sendmail emulation); Wed, 06 Jul 2022 16:37:04 -0700 Date: Wed, 06 Jul 2022 16:37:04 -0700 Message-Id: <73f6f1ed35feba3db337124a860bd2c89817db0e.1657149962.git.Thinh.Nguyen@synopsys.com> In-Reply-To: <cover.1657149962.git.Thinh.Nguyen@synopsys.com> References: <cover.1657149962.git.Thinh.Nguyen@synopsys.com> X-SNPS-Relay: synopsys.com From: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Subject: [PATCH 26/36] usb: gadget: f_tcm: Don't free command immediately To: Felipe Balbi <balbi@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thinh Nguyen <Thinh.Nguyen@synopsys.com>, linux-usb@vger.kernel.org, Dmitry Bogdanov <d.bogdanov@yadro.com>, Mike Christie <michael.christie@oracle.com>, Nicholas Bellinger <nab@linux-iscsi.org>, "Martin K. Petersen" <martin.petersen@oracle.com>, Roman Bolshakov <r.bolshakov@yadro.com> Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, Andrzej Pietrasiewicz <andrzej.p@samsung.com>, Sebastian Andrzej Siewior <bigeasy@linutronix.de> Precedence: bulk List-ID: <target-devel.vger.kernel.org> X-Mailing-List: target-devel@vger.kernel.org |
Series |
usb: gadget: f_tcm: Enhance UASP driver
|
expand
|
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,
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> --- drivers/usb/gadget/function/f_tcm.c | 1 - 1 file changed, 1 deletion(-)