2019-03-19 02:06:24

by Bo YU

[permalink] [raw]
Subject: [PATCH] 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)
Signed-off-by: Bo YU <[email protected]>
---
drivers/misc/fastrpc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 39f832d27288..36d0d5c9cfba 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -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;
}
--
2.11.0



2019-03-21 09:34:33

by Bo YU

[permalink] [raw]
Subject: Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

On Tue, Mar 19, 2019 at 10:05 AM Bo YU <[email protected]> wrote:
>
> 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)
> Signed-off-by: Bo YU <[email protected]>
> ---
> drivers/misc/fastrpc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 39f832d27288..36d0d5c9cfba 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -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;
> + }
>
Ping?
Do me need resend it?
> return 0;
> }
> --
> 2.11.0
>

2019-03-21 09:57:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

On Thu, Mar 21, 2019 at 05:31:51PM +0800, Bo YU wrote:
> On Tue, Mar 19, 2019 at 10:05 AM Bo YU <[email protected]> wrote:
> >
> > 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)
> > Signed-off-by: Bo YU <[email protected]>
> > ---
> > drivers/misc/fastrpc.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> > index 39f832d27288..36d0d5c9cfba 100644
> > --- a/drivers/misc/fastrpc.c
> > +++ b/drivers/misc/fastrpc.c
> > @@ -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;
> > + }
> >
> 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

2019-03-21 10:52:54

by Bo YU

[permalink] [raw]
Subject: Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

On Thu, Mar 21, 2019 at 5:56 PM Kroah-Hartman
<[email protected]> wrote:
>
> On Thu, Mar 21, 2019 at 05:31:51PM +0800, Bo YU wrote:
> > On Tue, Mar 19, 2019 at 10:05 AM Bo YU <[email protected]> wrote:
> > >
> > > 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)
> > > Signed-off-by: Bo YU <[email protected]>
> > > ---
> > > drivers/misc/fastrpc.c | 7 ++++++-
> > > 1 file changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> > > index 39f832d27288..36d0d5c9cfba 100644
> > > --- a/drivers/misc/fastrpc.c
> > > +++ b/drivers/misc/fastrpc.c
> > > @@ -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;
> > > + }
> > >
> > 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 :)
Ok, thank you. I am not sure the trival patch is ok so disturb you :)
>
> thanks,
>
> greg k-h

2019-03-27 18:31:16

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

On Mon, Mar 18, 2019 at 10:05:19PM -0400, Bo YU wrote:
> 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)
> Signed-off-by: Bo YU <[email protected]>
> ---
> 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

2019-03-28 01:08:43

by Bo YU

[permalink] [raw]
Subject: Re: [PATCH] misc/fastrpc: add checked value for dma_set_mask

On Thu, Mar 28, 2019 at 2:29 AM Greg KH <[email protected]> wrote:
>
> On Mon, Mar 18, 2019 at 10:05:19PM -0400, Bo YU wrote:
> > 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)
> > Signed-off-by: Bo YU <[email protected]>
> > ---
> > 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.
Ok, will do.
Thank you.
>
> thanks,
> greg k-h