USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy()

Test whether tusb_dma is not NULL before dereferencing

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Roel Kluin 2010-01-09 21:57:44 +01:00 committed by Greg Kroah-Hartman
parent f7410ced7f
commit 94089d56e4

View File

@ -648,7 +648,7 @@ void dma_controller_destroy(struct dma_controller *c)
} }
} }
if (!tusb_dma->multichannel && tusb_dma && tusb_dma->ch >= 0) if (tusb_dma && !tusb_dma->multichannel && tusb_dma->ch >= 0)
omap_free_dma(tusb_dma->ch); omap_free_dma(tusb_dma->ch);
kfree(tusb_dma); kfree(tusb_dma);