From patchwork Wed Dec 16 17:38:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 68589 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI57PW4014670 for ; Fri, 18 Dec 2009 05:07:25 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id nBGHb6XC006596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Dec 2009 11:37:07 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id nBGHb5oI026482; Wed, 16 Dec 2009 11:37:06 -0600 (CST) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4E02F80627; Wed, 16 Dec 2009 11:37:05 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 83CDE80626 for ; Wed, 16 Dec 2009 11:37:03 -0600 (CST) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id nBGHb2W1009841 for ; Wed, 16 Dec 2009 11:37:02 -0600 (CST) Received: from psmtp.com (na3sys009amx204.postini.com [74.125.149.44]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id nBGHb1v5013148 for ; Wed, 16 Dec 2009 11:37:01 -0600 Received: from source ([206.112.117.35]) by na3sys009amx204.postini.com ([74.125.148.10]) with SMTP; Wed, 16 Dec 2009 09:37:01 PST Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9]) by imap.sh.mvista.com (Postfix) with SMTP id 4F21E3ED9; Wed, 16 Dec 2009 09:36:59 -0800 (PST) From: Sergei Shtylyov Organization: MontaVista Software Inc. To: felipe.balbi@nokia.com, gregkh@suse.de Subject: [PATCH] musb_gadget: fix kernel oops in txstate() Date: Wed, 16 Dec 2009 20:38:31 +0300 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200912162038.31532.sshtylyov@ru.mvista.com> X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:56.98330/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 X-pstn-addresses: from [db-null] Cc: davinci-linux-open-source@linux.davincidsp.com, linux-usb@vger.kernel.org X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Index: linux-2.6/drivers/usb/musb/musb_gadget.c =================================================================== --- linux-2.6.orig/drivers/usb/musb/musb_gadget.c +++ linux-2.6/drivers/usb/musb/musb_gadget.c @@ -515,12 +515,12 @@ void musb_g_tx(struct musb *musb, u8 epn if (csr & MUSB_TXCSR_FIFONOTEMPTY) return; - if (!musb_ep->desc) { + request = musb_ep->desc ? next_request(musb_ep) : NULL; + if (!request) { DBG(4, "%s idle now\n", musb_ep->end_point.name); return; - } else - request = next_request(musb_ep); + } } txstate(musb, to_musb_request(request));