Re: [PATCH 0/5] nouveau/gsp: Cleanup IS_ERR_OR_NULL() usage

From: lyude

Date: Thu May 28 2026 - 15:16:29 EST


On Thu, 2026-05-28 at 19:06 +0000, Timur Tabi wrote:
> On Thu, 2026-05-28 at 19:56 +0200, Danilo Krummrich wrote:
> > I think at least this patch has to be reverted, it causes the
> > following oops
> > probing nouveau on my machine.
> >
> > I can't currently look into this, but I think Sashiko [1] has a
> > valid point on
> > this one.
>
> I'm not a fan of this series.  When I saw the number of patches, I
> was suspicious, because I have a
> hard time believing that there were so many functions that never
> returned NULL.  The call tree of a
> lot of Nouveau code is pretty deep, and it takes quite a lot of work
> to ensure that there is no
> "return NULL" in any code path.
>
> Nouveau is kinda sloppy in this regard, which is why IS_ERR_OR_NULL
> is used so much.  It's a safety
> measure.

FWIW: I already sent a revert for the last patch in the series which
needs a review, but I'm happy to send out a revert for the whole thing
if we want.

You are right - I did actually sit down and try to run through all of
the codepaths for all these functions, but there's clearly a number
that I missed and should have checked sashiko for.