From patchwork Tue Sep 22 20:10:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru M Stan X-Patchwork-Id: 7245271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F93CBEEC1 for ; Tue, 22 Sep 2015 20:14:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6830720A1A for ; Tue, 22 Sep 2015 20:14:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA55B20A13 for ; Tue, 22 Sep 2015 20:14:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeTuh-0001iQ-KY; Tue, 22 Sep 2015 20:11:43 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeTuW-0001d9-Cn for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2015 20:11:33 +0000 Received: by pacfv12 with SMTP id fv12so18565075pac.2 for ; Tue, 22 Sep 2015 13:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G1U0Z0zP1lnE98ZT/CmQVVzVZMfLhERAxjO1qr5UVU8=; b=k6KbUcX8Y4yHUlX0Enlfm2CrtYOJT+/JBBL6PrBTlop2x3yWUqT/KciD6dA1yFD3I+ X2AkVbQQvBi6D6usskQxAwP5W36WCL/qU/hEhUYGbHsrqhvjHpcXNlLjuftsCpMy/YC6 xeUSlRzQdT9+f5OEVUu+USfw+JFS7JCEkAtcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G1U0Z0zP1lnE98ZT/CmQVVzVZMfLhERAxjO1qr5UVU8=; b=MqD7OU1B+BLws2LpiJl2vEzAboLGvSGCW7PYm7DUMv8ybqATf4Y9eu6kGejm08jh5S qeFKQa2LLLlt8fnXbq79dt9rNic3x/ZYREQY/37nSoxOuCz75fZ7yxxbB6gDgha228xY 4JJ85ncTAFgD+dpqLl1YwCCPdTS88qgi5DVMlvqf4OVUmB+ve0t9xpY/UQbnpo0FdkVe XPqPdivL/IQ9ihKkdSdIRswGpcV0QWPoDWbkxH4xpmMzFd0vG9DC48SSxjfYwIDkIu0L Ovex9ybpN6hQUokO2an7AC0LfNTViYYoHMOomQiXIK4bKEX9MWs3pUQo062KmyuAcfyg AbGA== X-Gm-Message-State: ALoCoQnpAuu27j8Vm8kuSRKchJ9bg7svR81iQEmxqe+WGYyfek1P0lpQWXGYsxBJNLeToRUFtjdL X-Received: by 10.68.202.9 with SMTP id ke9mr33249797pbc.85.1442952671733; Tue, 22 Sep 2015 13:11:11 -0700 (PDT) Received: from amstan.mtv.corp.google.com ([100.96.109.27]) by smtp.gmail.com with ESMTPSA id un2sm3856866pac.28.2015.09.22.13.11.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Sep 2015 13:11:11 -0700 (PDT) From: Alexandru M Stan To: John Youn , Paul Zimmerman Subject: [PATCH] usb: dwc2: Fix NULL qh in dwc2_queue_transaction Date: Tue, 22 Sep 2015 13:10:51 -0700 Message-Id: <1442952651-4341-2-git-send-email-amstan@chromium.org> X-Mailer: git-send-email 2.6.0.rc0.131.gf624c3d In-Reply-To: <1442952651-4341-1-git-send-email-amstan@chromium.org> References: <1442952651-4341-1-git-send-email-amstan@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150922_131132_561767_23AF5934 X-CRM114-Status: GOOD ( 13.67 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , gregkh@linuxfoundation.org, Jonathan Dixon , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Douglas Anderson , linux-rockchip@lists.infradead.org, Mian Yousaf Kaukab , linux-arm-kernel@lists.infradead.org, Alexandru M Stan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When a usb device disconnects in a certain way, dwc2_queue_transaction still gets called after dwc2_hcd_cleanup_channels. dwc2_hcd_cleanup_channels does "channel->qh = NULL;" but dwc2_queue_transaction still wants to dereference qh. This adds a check for a null qh. Signed-off-by: Alexandru M Stan --- drivers/usb/dwc2/hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index f845c41..d745128 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -1004,7 +1004,7 @@ static int dwc2_queue_transaction(struct dwc2_hsotg *hsotg, { int retval = 0; - if (hsotg->core_params->dma_enable > 0) { + if (hsotg->core_params->dma_enable > 0 && chan->qh) { if (hsotg->core_params->dma_desc_enable > 0) { if (!chan->xfer_started || chan->ep_type == USB_ENDPOINT_XFER_ISOC) {