summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2020-01-28 14:39:26 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-24 08:34:52 +0100
commitae2f1cd6a3aa4745255ab0eb5bf264f9bd89ee6c (patch)
tree7bef3ba319e5313be39108073458b042f635880f
parent60f3843b695b9bccaff70a46d5975613d5386c7d (diff)
downloadlinux-stable-ae2f1cd6a3aa4745255ab0eb5bf264f9bd89ee6c.tar.gz
linux-stable-ae2f1cd6a3aa4745255ab0eb5bf264f9bd89ee6c.tar.bz2
linux-stable-ae2f1cd6a3aa4745255ab0eb5bf264f9bd89ee6c.zip
drm/nouveau/disp/nv50-: prevent oops when no channel method map provided
[ Upstream commit 0e6176c6d286316e9431b4f695940cfac4ffe6c2 ] The implementations for most channel types contains a map of methods to priv registers in order to provide debugging info when a disp exception has been raised. This info is missing from the implementation of PIO channels as they're rather simplistic already, however, if an exception is raised by one of them, we'd end up triggering a NULL-pointer deref. Not ideal... Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206299 Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
index bcf32d92ee5a..50e3539f33d2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
@@ -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;