Skip to content

Commit

Permalink
dma: imx-dma: fix signedness bug
Browse files Browse the repository at this point in the history
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 <segooon@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Sascha Hauer authored and Dan Williams committed Oct 22, 2010
1 parent 42e5573 commit 8267f16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/dma/imx-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8267f16

Please sign in to comment.