From 52fd2a25426fac43422589ada027ab208de20e32 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 3 May 2020 16:19:53 +0200 Subject: [PATCH] nouveau: fix crash in pushbuf_dump with an unmapped bo Signed-off-by: Karol Herbst Reviewed-by: Ilia Mirkin --- nouveau/pushbuf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c index e5f73f0d..363ff0fc 100644 --- a/nouveau/pushbuf.c +++ b/nouveau/pushbuf.c @@ -294,9 +294,12 @@ pushbuf_dump(struct nouveau_pushbuf_krec *krec, int krec_id, int chid) bgn = (uint32_t *)((char *)bo->map + kpsh->offset); end = bgn + (kpsh->length /4); - err("ch%d: psh %08x %010llx %010llx\n", chid, kpsh->bo_index, + err("ch%d: psh %s%08x %010llx %010llx\n", chid, + bo->map ? "" : "(unmapped) ", kpsh->bo_index, (unsigned long long)kpsh->offset, (unsigned long long)(kpsh->offset + kpsh->length)); + if (!bo->map) + continue; while (bgn < end) err("\t0x%08x\n", *bgn++); }