Skip to contentSkip to conversation

misc/fastrpc: add checked value for dma_set_mask

PATCH Superseded Bo YU 2 participants 6 messages Mar 19, 2019 – Mar 28, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Bo YU

author
#0 lore raw

PATCH 1/1 misc/fastrpc: add checked value for dma_set_mask

There be should check return value from dma_set_mask to throw some infos if fail to set dma mask.

Detected by CoverityScan, CID# 1443983: Error handling issues (CHECKED_RETURN)

Fixes f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
---
 drivers/misc/fastrpc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/fastrpc.c +6 -1
index 39f832d27288..36d0d5c9cfba 100644
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
 	struct fastrpc_session_ctx *sess;
 	struct device *dev = &pdev->dev;
 	int i, sessions = 0;
+	int rc;
 
 	cctx = dev_get_drvdata(dev->parent);
 	if (!cctx)
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
 	}
 	cctx->sesscount++;
 	spin_unlock(&cctx->lock);
-	dma_set_mask(dev, DMA_BIT_MASK(32));
+	rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+	if (rc) {
+		dev_err(dev, "32-bit DMA enable failed\n");
+		return rc;
+	}
 
 	return 0;
 }
Signature · 1 line
2.11.0
author
#1 lore raw
Quoted 25 lines · Bo YU

There be should check return value from dma_set_mask to throw some infos if fail to set dma mask.

Detected by CoverityScan, CID# 1443983: Error handling issues (CHECKED_RETURN)

Fixes f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
---
 drivers/misc/fastrpc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -0
index 39f832d27288..36d0d5c9cfba 100644
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
        struct fastrpc_session_ctx *sess;
        struct device *dev = &pdev->dev;
        int i, sessions = 0;
+       int rc;
 
        cctx = dev_get_drvdata(dev->parent);
        if (!cctx)

drivers/misc/fastrpc.c static int fastrpc_cb_probe(struct platform_device *pdev) · line 1222

Quoted 10 lines
drivers/misc/fastrpc.c +5 -1
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
        }
        cctx->sesscount++;
        spin_unlock(&cctx->lock);
-       dma_set_mask(dev, DMA_BIT_MASK(32));
+       rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+       if (rc) {
+               dev_err(dev, "32-bit DMA enable failed\n");
+               return rc;
+       }
 

Ping?
Do me need resend it?

Quoted 5 lines
drivers/misc/fastrpc.c +0 -1
        return 0;
 }
--

2.11.0

maintainer
#2 lore raw
Quoted 23 lines · Bo YU
Quoted 22 lines · Bo YU

There be should check return value from dma_set_mask to throw some infos if fail to set dma mask.

Detected by CoverityScan, CID# 1443983: Error handling issues (CHECKED_RETURN)

Fixes f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
---
 drivers/misc/fastrpc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -0
index 39f832d27288..36d0d5c9cfba 100644
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
        struct fastrpc_session_ctx *sess;
        struct device *dev = &pdev->dev;
        int i, sessions = 0;
+       int rc;
 
Quoted 15 lines

drivers/misc/fastrpc.c static int fastrpc_cb_probe(struct platform_device *pdev) · line 1222

Quoted 13 lines
drivers/misc/fastrpc.c +5 -1
        cctx = dev_get_drvdata(dev->parent);
        if (!cctx)
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
        }
        cctx->sesscount++;
        spin_unlock(&cctx->lock);
-       dma_set_mask(dev, DMA_BIT_MASK(32));
+       rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+       if (rc) {
+               dev_err(dev, "32-bit DMA enable failed\n");
+               return rc;
+       }
 

Ping?
Do me need resend it?

2 days? Please give us time to catch up on patches, right after the merge window closed. This isn't a big deal, we have much higher priority patches to review. It will be gotten to eventually :)

thanks,

greg k-h

author
#3 lore raw
Quoted 41 lines · Kroah-Hartman
Quoted 23 lines · Bo YU
Quoted 22 lines · Bo YU

There be should check return value from dma_set_mask to throw some infos if fail to set dma mask.

Detected by CoverityScan, CID# 1443983: Error handling issues (CHECKED_RETURN)

Fixes f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
---
 drivers/misc/fastrpc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -0
index 39f832d27288..36d0d5c9cfba 100644
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
        struct fastrpc_session_ctx *sess;
        struct device *dev = &pdev->dev;
        int i, sessions = 0;
+       int rc;
 
Quoted 15 lines

drivers/misc/fastrpc.c static int fastrpc_cb_probe(struct platform_device *pdev) · line 1222

Quoted 13 lines
drivers/misc/fastrpc.c +5 -1
        cctx = dev_get_drvdata(dev->parent);
        if (!cctx)
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
        }
        cctx->sesscount++;
        spin_unlock(&cctx->lock);
-       dma_set_mask(dev, DMA_BIT_MASK(32));
+       rc = dma_set_mask(dev, DMA_BIT_MASK(32));
+       if (rc) {
+               dev_err(dev, "32-bit DMA enable failed\n");
+               return rc;
+       }
 

Ping?
Do me need resend it?

Quoted 3 lines

2 days? Please give us time to catch up on patches, right after the merge window closed. This isn't a big deal, we have much higher priority patches to review. It will be gotten to eventually :)

Ok, thank you. I am not sure the trival patch is ok so disturb you :)

Quoted 4 lines

thanks,

greg k-h

maintainer
#4 lore raw
In reply to Bo YU
Quoted 10 lines · Bo YU

There be should check return value from dma_set_mask to throw some infos if fail to set dma mask.

Detected by CoverityScan, CID# 1443983: Error handling issues (CHECKED_RETURN)

Fixes f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
---
 drivers/misc/fastrpc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

This patch no longer applies to my tree due to other fastrpc fixes being sent before your patch :(

Please rebase and resend.

thanks,
greg k-h

author
#5 lore raw
Quoted 13 lines · Greg KH
Quoted 10 lines · Bo YU

There be should check return value from dma_set_mask to throw some infos if fail to set dma mask.

Detected by CoverityScan, CID# 1443983: Error handling issues (CHECKED_RETURN)

Fixes f6f9279f2bf0 (misc: fastrpc: Add Qualcomm fastrpc basic driver model)
---
 drivers/misc/fastrpc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Quoted 4 lines

This patch no longer applies to my tree due to other fastrpc fixes being sent before your patch :(

Please rebase and resend.

Ok, will do.
Thank you.

Quoted 3 lines

thanks,
greg k-h