Re: [PATCH] drm/nouveau/gsp: Fix possible NULL pointer dereference warning in r535_dmac_alloc
From: Danilo Krummrich
Date: Sat Apr 18 2026 - 13:35:32 EST
On Sat Apr 18, 2026 at 7:24 PM CEST, Timur Tabi wrote:
> On Sat, 2026-04-18 at 14:12 +0200, Danilo Krummrich wrote:
>> Are we sure that this can ever return NULL in the first place? I know that
>> nvkm_gsp_rm_alloc_get() internally checks for IS_ERR_OR_NULL(), but I couldn't
>> find anything within the callchain that would actually return NULL.
>>
>> That said, I think IS_ERR_OR_NULL() checks are misleading.
>
> I posted a patch a couple months ago that cleans up an IS_ERR check, but it was never picked up:
Thanks! Can you please make sure to send patches to all maintainers? If they
don't land in my inbox, I can't pick them up. :(
> https://lore.freedesktop.org/nouveau/20260103000756.1002890-1-ttabi@xxxxxxxxxx/T/#u
>
> I'm quite certain that there are other similar issues in Nouveau w.r.t. IS_ERR_OR_NULL.
Yeah, that sounds likely.
> I think an audit of the Nouveau error paths is in order. I suspect that Ben's big refactors
> over the past year have resulted in some invalid error paths.
Are you planning to look into this?
Thanks,
Danilo