2010-01-09 20:53:43

by Roel Kluin

[permalink] [raw]
Subject: [PATCH] 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 <[email protected]>
---
drivers/usb/musb/tusb6010_omap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c
index e13c770..1c86809 100644
--- a/drivers/usb/musb/tusb6010_omap.c
+++ b/drivers/usb/musb/tusb6010_omap.c
@@ -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);


2010-01-29 10:43:46

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] musb: don't dereference NULL tusb_dma in dma_controller_destroy()

On Sat, Jan 09, 2010 at 09:57:44PM +0100, ext Roel Kluin wrote:
>Test whether tusb_dma is not NULL before dereferencing
>
>Signed-off-by: Roel Kluin <[email protected]>

Acked-by: Felipe Balbi <[email protected]>

--
balbi