From 8267f16e8b67ea272f37f7072933dc0d3839693d Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 20 Oct 2010 08:37:19 +0200 Subject: [PATCH] dma: imx-dma: fix signedness bug mxdmac->channel was unsigned, so check (imxdmac->channel < 0) for failed imx_dma_request_by_prio() made no sence. Explicitly check signed values. Also, fix uninitialzed use of ret. Signed-off-by: Vasiliy Kulikov Signed-off-by: Sascha Hauer Signed-off-by: Dan Williams --- drivers/dma/imx-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 346be6218058..f629e4961af5 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -335,8 +335,10 @@ static int __init imxdma_probe(struct platform_device *pdev) imxdmac->imxdma_channel = imx_dma_request_by_prio("dmaengine", DMA_PRIO_MEDIUM); - if (imxdmac->channel < 0) + if ((int)imxdmac->channel < 0) { + ret = -ENODEV; goto err_init; + } imx_dma_setup_handlers(imxdmac->imxdma_channel, imxdma_irq_handler, imxdma_err_handler, imxdmac); -- 2.20.1