mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason-ch Chen (陳建豪)" <Jason-ch.Chen@mediatek.com>
To: "mathieu.poirier@linaro.org" <mathieu.poirier@linaro.org>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"bjorn.andersson@linaro.org" <bjorn.andersson@linaro.org>,
	Project_Global_Chrome_Upstream_Group 
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>
Subject: Re: [PATCH] remoteproc: mediatek: Dereferencing a pointer that might be NULL
Date: Thu, 9 Mar 2023 08:24:19 +0000	[thread overview]
Message-ID: <29643c069485b2c7e49fd9e40c26b60f86a63a86.camel@mediatek.com> (raw)
In-Reply-To: <CANLsYky0pbqiEfq7E6DZM=J+sm2JJ8gYST2atUyP8X7y9zdHWA@mail.gmail.com>

Hi Mathieu,

On Fri, 2023-03-03 at 11:20 -0700, Mathieu Poirier wrote:
> On Fri, 3 Mar 2023 at 03:28, Jason-ch Chen <
> jason-ch.chen@mediatek.com> wrote:
> > 
> > From: jason-ch chen <Jason-ch.Chen@mediatek.com>
> > 
> > The res might be NULL when calling resource_size.
> > 
> 
> "resource_size" ?  What is that?
> 
> > Signed-off-by: jason-ch chen <Jason-ch.Chen@mediatek.com>
> > ---
> >  drivers/remoteproc/mtk_scp.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/remoteproc/mtk_scp.c
> > b/drivers/remoteproc/mtk_scp.c
> > index eacdf241f4ef..863d18f63f58 100644
> > --- a/drivers/remoteproc/mtk_scp.c
> > +++ b/drivers/remoteproc/mtk_scp.c
> > @@ -829,6 +829,9 @@ static int scp_probe(struct platform_device
> > *pdev)
> >         platform_set_drvdata(pdev, scp);
> > 
> >         res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> > "sram");
> > +       if (!res)
> > +               return -ENODEV;
> > +
> 
> Please have a look at the implementation of devm_ioremap_resource()
> along with the function it calls and let me know if your patch is
> needed.
> 
Thanks for your reply.
It seems is patch is not needed.
> >         scp->sram_base = devm_ioremap_resource(dev, res);
> >         if (IS_ERR((__force void *)scp->sram_base)) {
> >                 dev_err(dev, "Failed to parse and map sram
> > memory\n");
> > --
> > 2.37.3
> > 

      reply	other threads:[~2023-03-09  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 10:27 Jason-ch Chen
2023-03-03 18:20 ` Mathieu Poirier
2023-03-09  8:24   ` Jason-ch Chen (陳建豪) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29643c069485b2c7e49fd9e40c26b60f86a63a86.camel@mediatek.com \
    --to=jason-ch.chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®