[lvc-project] [PATCH] drm/nouveau/disp: Fix potential NULL pointer dereference in nouveau_dp_irq

SDL sdl at nppct.ru
Mon Mar 16 21:09:19 MSK 2026


> Can you provide an example of how/when this would be the case?

The issue was discovered through static analysis after reviewing changes 
introduced
by commit 773eb04d14a1 ("drm/nouveau/disp: expose conn event class").

Originally, nouveau_dp_irq() checked the result of find_encoder() before 
using it:

     struct nouveau_encoder *outp = find_encoder(connector, DCB_OUTPUT_DP);

     if (!outp)
         return;

Commit 773eb04d14a1 introduced the line:

     struct nouveau_drm *drm = nouveau_drm(outp->base.base.dev);

before the existing if (!outp) guard. As a result, outp is now dereferenced
prior to the NULL check. The patch simply restores the correct ordering 
by moving
the initialization of drm after the outp validation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20260316/efeef43c/attachment.html>


More information about the lvc-project mailing list