summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/sec2
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2017-03-10 17:16:48 +0900
committerDave Airlie <airlied@redhat.com>2017-03-17 12:06:58 +1000
commitb7d6c8db498cdbbd0004970d02c86210ce3a6cbc (patch)
treecc8af2a8e4763159e66f89518f8ef7f18056467c /drivers/gpu/drm/nouveau/nvkm/engine/sec2
parentaa7fc0ca759eb25eea6dc0fee4373e5883a17498 (diff)
drm/nouveau/secboot: fix NULL pointer dereference
The msgqueue pointer validity should be checked by its owner, not by the msgqueue code itself to avoid this situation. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/sec2')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c
index 814daf35e21f..f865d2a3e184 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/base.c
@@ -59,6 +59,13 @@ static void
nvkm_sec2_recv(struct work_struct *work)
{
struct nvkm_sec2 *sec2 = container_of(work, typeof(*sec2), work);
+
+ if (!sec2->queue) {
+ nvkm_warn(&sec2->engine.subdev,
+ "recv function called while no firmware set!\n");
+ return;
+ }
+
nvkm_msgqueue_recv(sec2->queue);
}