usb: musb: tusb: Fix possible null pointer dereference in tusb6010_omap.c
authorHuzaifa Sidhpurwala <huzaifas@redhat.com>
Tue, 1 Mar 2011 10:24:22 +0000 (15:54 +0530)
committerFelipe Balbi <balbi@ti.com>
Tue, 1 Mar 2011 10:35:23 +0000 (12:35 +0200)
tusb_dma was being dereferenced when it was nul

Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/tusb6010_omap.c

index c061a88f2b0f96199656f725382209ade44680f9..99cb541e4ef0375c7b358ed5787144c2b8bb9fcc 100644 (file)
@@ -680,7 +680,7 @@ dma_controller_create(struct musb *musb, void __iomem *base)
 
        tusb_dma = kzalloc(sizeof(struct tusb_omap_dma), GFP_KERNEL);
        if (!tusb_dma)
-               goto cleanup;
+               goto out;
 
        tusb_dma->musb = musb;
        tusb_dma->tbase = musb->ctrl_base;
@@ -721,6 +721,6 @@ dma_controller_create(struct musb *musb, void __iomem *base)
 
 cleanup:
        dma_controller_destroy(&tusb_dma->controller);
-
+out:
        return NULL;
 }