From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
<frederic.pierret@qubes-os.org>
Date: Sun, 26 Jan 2020 23:24:33 +0100
Subject: [PATCH] nv50_disp_chan_mthd: ensure mthd is not NULL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Pointer to structure array is assumed not NULL by default. It has
the consequence to raise a kernel panic when it's not the case.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206299
Signed-off-by: Frédéric Pierret (fepitre) <frederic.pierret@qubes-os.org>
---
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 2 ++
1 file changed, 2 insertions(+)
@@ -74,6 +74,8 @@ nv50_disp_chan_mthd(struct nv50_disp_chan *chan, int debug)
if (debug > subdev->debug)
return;
+ if (!mthd)
+ return;
for (i = 0; (list = mthd->data[i].mthd) != NULL; i++) {
u32 base = chan->head * mthd->addr;
--
2.21.0