Skip to content

Commit

Permalink
USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent f7410ce commit 94089d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/musb/tusb6010_omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 94089d5

Please sign in to comment.