Skip to content

Commit 55b94bb

Browse files
Natalia PetrovaLyude
authored andcommitted
drm/nouveau: add nv_encoder pointer check for NULL
Pointer nv_encoder could be dereferenced at nouveau_connector.c in case it's equal to NULL by jumping to goto label. This patch adds a NULL-check to avoid it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 3195c5f ("drm/nouveau: set encoder for lvds") Signed-off-by: Natalia Petrova <[email protected]> Reviewed-by: Lyude Paul <[email protected]> [Fixed patch title] Signed-off-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 20a2ce8 commit 55b94bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/nouveau/nouveau_connector.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force)
730730
#endif
731731

732732
nouveau_connector_set_edid(nv_connector, edid);
733-
nouveau_connector_set_encoder(connector, nv_encoder);
733+
if (nv_encoder)
734+
nouveau_connector_set_encoder(connector, nv_encoder);
734735
return status;
735736
}
736737

0 commit comments

Comments
 (0)