Skip to contentSkip to conversation

i2c: imx: fix inconsistent IS_ERR and PTR_ERR

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jan 23, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: imx: fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in i2c_imx_dma_request.

The proper pointer to be passed as argument is dma->chan_tx.

This bug was detected with the help of Coccinelle.

Fixes 5b3a23a3cc94 ("i2c: imx: notify about real errors on dma i2c_imx_dma_request")
---
 drivers/i2c/busses/i2c-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-imx.c +1 -1
index 09b124547669..42fed40198a0 100644
@@ -287,7 +287,7 @@ static int i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
 
 	dma->chan_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(dma->chan_tx)) {
-		ret = PTR_ERR(dma->chan_rx);
+		ret = PTR_ERR(dma->chan_tx);
 		if (ret != -ENODEV && ret != -EPROBE_DEFER)
 			dev_err(dev, "can't request DMA tx channel (%d)\n", ret);
 		goto fail_al;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in i2c_imx_dma_request.

The proper pointer to be passed as argument is dma->chan_tx.

This bug was detected with the help of Coccinelle.

Fixes 5b3a23a3cc94 ("i2c: imx: notify about real errors on dma i2c_imx_dma_request")

I pushed a similar fix to linux-next yesterday.

#2 lore raw
Quoted 12 lines · Wolfram Sang
Quoted 8 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in i2c_imx_dma_request.

The proper pointer to be passed as argument is dma->chan_tx.

This bug was detected with the help of Coccinelle.

Fixes 5b3a23a3cc94 ("i2c: imx: notify about real errors on dma i2c_imx_dma_request")

I pushed a similar fix to linux-next yesterday.

Great. Good to know it is fixed now. :)

Thanks
--
Gustavo