linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@chromium.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Akhil P Oommen <akhilpo@codeaurora.org>,
	kbuild@lists.01.org, lkp@intel.com, kbuild-all@lists.01.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [kbuild] drivers/gpu/drm/msm/adreno/a3xx_gpu.c:600 a3xx_gpu_init() error: passing non negative 1 to ERR_PTR
Date: Fri, 16 Apr 2021 08:15:22 -0700	[thread overview]
Message-ID: <CAJs_Fx4WY9B_FudZtSe1hOkLbqy5pFZ=O-dfNJWtWMkJ=8ySbg@mail.gmail.com> (raw)
In-Reply-To: <20210416043336.GM6048@kadam>

On Thu, Apr 15, 2021 at 9:33 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Thu, Apr 15, 2021 at 04:21:01PM -0700, Rob Clark wrote:
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  571         icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  572         ret = IS_ERR(icc_path);
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  573         if (ret)
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  574                 goto fail;
> > > >
> > > > IS_ERR() returns/true false so this will lead to an Oops in the caller.
> > > >
> > > >       icc_path = devm_of_icc_get(&pdev->dev, "gfx-mem");
> > > >       if (IS_ERR(icc_path)) {
> > > >               ret = PTR_ERR(icc_path);
> > > >               goto fail;
> > > >       }
> > > Agree.
> > >
> > > >
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  575
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  576         ocmem_icc_path = devm_of_icc_get(&pdev->dev, "ocmem");
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  577         ret = IS_ERR(ocmem_icc_path);
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  578         if (ret) {
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  579                 /* allow -ENODATA, ocmem icc is optional */
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  580                 if (ret != -ENODATA)
> > > > 5785dd7a8ef0de Akhil P Oommen 2020-10-28  581                         goto fail;
> > > >
> > > > Same.  ret is true/false so it can't be equal to -ENODATA, plus the
> > > > caller will Oops.
> > > >
> > > > Btw, this patch removed the assignments:
> > > >
> > > >               gpu->icc_path = of_icc_get(dev, "gfx-mem");
> > > >               gpu->ocmem_icc_path = of_icc_get(dev, "ocmem");
> > > >
> > > > So I think "gpu->icc_path" and "gpu->ocmem_icc_path" are always
> > > > NULL/unused and they should be removed.
> > > >
> > > Agree. Will share a fix.
> > > Thanks, Dan.
> >
> > gpu->ocmem_icc_path/icc_path is used on older devices.. it sounds like
> > we broke some older devices and no one has noticed yet?
>
> This is error paths and dead code.  Probably no one is affected in
> real life.
>

oh, right, we are using devm now, so we can drop the icc_put()s

BR,
-R

      reply	other threads:[~2021-04-16 15:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09  9:37 [kbuild] drivers/gpu/drm/msm/adreno/a3xx_gpu.c:600 a3xx_gpu_init() error: passing non negative 1 to ERR_PTR Dan Carpenter
2021-04-15 16:51 ` Akhil P Oommen
2021-04-15 23:21   ` Rob Clark
2021-04-16  4:33     ` Dan Carpenter
2021-04-16 15:15       ` Rob Clark [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='CAJs_Fx4WY9B_FudZtSe1hOkLbqy5pFZ=O-dfNJWtWMkJ=8ySbg@mail.gmail.com' \
    --to=robdclark@chromium.org \
    --cc=akhilpo@codeaurora.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.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;
as well as URLs for NNTP newsgroup(s).