USB: musb: Fix null pointer dereference issue
authorMaulik Mankad <x0082077@ti.com>
Tue, 22 Dec 2009 10:48:19 +0000 (16:18 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Dec 2009 19:34:19 +0000 (11:34 -0800)
commit0abdc36f066ae20521b8c8d306725dd59a0d50aa
tree39b8392093276bb1a5ae3bb68b8ebef8062ad4e3
parent796a83fa039de50133171221ac102a2310e81ffd
USB: musb: Fix null pointer dereference issue

This patch fixes the following NULL pointer dereference issue.

Pointer 'request' returned from call to function 'next_request'
at line 748 may be NULL and may be dereferenced at line 792.

============
Code Snippet
============

748:  request = next_request(musb_ep);
785: if (dma && (csr & MUSB_RXCSR_DMAENAB)) {
csr &= ~(MUSB_RXCSR_AUTOCLEAR
| MUSB_RXCSR_DMAENAB
| MUSB_RXCSR_DMAMODE);
musb_writew(epio, MUSB_RXCSR,
MUSB_RXCSR_P_WZC_BITS | csr);

792:  request->actual += musb_ep->dma->actual_len;

Signed-off-by: Maulik Mankad <x0082077@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/musb_gadget.c