Commit 94089d56 authored by Roel Kluin's avatar Roel Kluin Committed by Greg Kroah-Hartman

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

Test whether tusb_dma is not NULL before dereferencing
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f7410ced
......@@ -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);
kfree(tusb_dma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment