From patchwork Fri May 20 20:10:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Liu X-Patchwork-Id: 9130039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 769526048B for ; Fri, 20 May 2016 20:10:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A2E720453 for ; Fri, 20 May 2016 20:10:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E38027D00; Fri, 20 May 2016 20:10:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3C8227BF1 for ; Fri, 20 May 2016 20:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750909AbcETUKg (ORCPT ); Fri, 20 May 2016 16:10:36 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:37654 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbcETUKf (ORCPT ); Fri, 20 May 2016 16:10:35 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u4KKAKJa028699; Fri, 20 May 2016 15:10:20 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u4KKAJ44019558; Fri, 20 May 2016 15:10:19 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Fri, 20 May 2016 15:10:19 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u4KKAJLK006403; Fri, 20 May 2016 15:10:19 -0500 Date: Fri, 20 May 2016 15:10:19 -0500 From: Bin Liu To: "Matwey V. Kornilov" CC: Linux OMAP List , , Subject: Re: [OOPS] cppi41_dma_channel_program: Unable to handle kernel NULL pointer dereference Message-ID: <20160520201019.GA3432@uda0271908> Mail-Followup-To: Bin Liu , "Matwey V. Kornilov" , Linux OMAP List , linux-usb@vger.kernel.org, dmaengine@vger.kernel.org References: <1463750386-6259-1-git-send-email-matwey@sai.msu.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On Fri, May 20, 2016 at 04:32:06PM +0300, Matwey V. Kornilov wrote: > 2016-05-20 16:19 GMT+03:00 : > > Hello, > > > > I am running 4.6-rc3 on BealgeBone Black and when I try to interract > > with pwc webcam attached to usb port the following kernel panic > > happening. > > Please note, that the same is happening with 4.6.0 release. Please apply the following patch and reproduce the oops, I'd like to check if the oops is caused by NULL of hw_ep->in_qh. Regards, -Bin. ---8<------- --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index e499b86..3492c6e 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -489,8 +489,11 @@ static int cppi41_dma_channel_program(struct dma_channel *channel, if (is_host_active(cppi41_channel->controller->musb)) { if (cppi41_channel->is_tx) hb_mult = cppi41_channel->hw_ep->out_qh->hb_mult; - else + else { + if (!cppi41_channel->hw_ep->in_qh) + dev_err(NULL, "->in_qh is NULL\n"); hb_mult = cppi41_channel->hw_ep->in_qh->hb_mult; + } } channel->status = MUSB_DMA_STATUS_BUSY;