[PATCH v6 2/2] DMA: imx-dma: imxdma->dev used uninitialized

Markus Pargmann mpa at pengutronix.de
Sun Apr 21 05:08:23 EDT 2013


imxdma->dev is used for dev_warn before it was set.

Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo at linaro.org>
---
 drivers/dma/imx-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index b74b249..b9aa549 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -1068,6 +1068,7 @@ static int __init imxdma_probe(struct platform_device *pdev)
 	if (!imxdma)
 		return -ENOMEM;
 
+	imxdma->dev = &pdev->dev;
 	imxdma->devtype = pdev->id_entry->driver_data;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1172,7 +1173,6 @@ static int __init imxdma_probe(struct platform_device *pdev)
 			      &imxdma->dma_device.channels);
 	}
 
-	imxdma->dev = &pdev->dev;
 	imxdma->dma_device.dev = &pdev->dev;
 
 	imxdma->dma_device.device_alloc_chan_resources = imxdma_alloc_chan_resources;
-- 
1.8.1.5




More information about the linux-arm-kernel mailing list