drm/nouveau: add nv_encoder pointer check for NULL
authorNatalia Petrova <n.petrova@fintech.ru>
Fri, 12 May 2023 10:33:20 +0000 (13:33 +0300)
committerLyude Paul <lyude@redhat.com>
Tue, 13 Jun 2023 20:53:00 +0000 (16:53 -0400)
commit55b94bb8c42464bad3d2217f6874aa1a85664eac
tree8c2d1fc76afea503890ff2bf9a694cb888ae7605
parent20a2ce87fbaf81e4c3dcb631d738e423959eb320
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: 3195c5f9784a ("drm/nouveau: set encoder for lvds")
Signed-off-by: Natalia Petrova <n.petrova@fintech.ru>
Reviewed-by: Lyude Paul <lyude@redhat.com>
[Fixed patch title]
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230512103320.82234-1-n.petrova@fintech.ru
drivers/gpu/drm/nouveau/nouveau_connector.c