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.

Reply via email to