Skip to contentSkip to conversation

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

PATCH In review Roel Kluin 2 participants 2 messages Jan 9, 2010 – Jan 29, 2010

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 musb: don't dereference NULL tusb_dma in dma_controller_destroy()

Test whether tusb_dma is not NULL before dereferencing

---
 drivers/usb/musb/tusb6010_omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/musb/tusb6010_omap.c +1 -1
index e13c770..1c86809 100644
@@ -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);