diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2017-03-10 09:16:48 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-03-17 03:06:58 +0100 |
commit | b7d6c8db498cdbbd0004970d02c86210ce3a6cbc (patch) | |
tree | cc8af2a8e4763159e66f89518f8ef7f18056467c /drivers/gpu/drm/nouveau/nvkm/subdev/pmu | |
parent | drm/nouveau/secboot: fix inconsistent pointer checking (diff) | |
download | linux-b7d6c8db498cdbbd0004970d02c86210ce3a6cbc.tar.xz linux-b7d6c8db498cdbbd0004970d02c86210ce3a6cbc.zip |
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/subdev/pmu')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c index 48ae02d45656..44bef22bce52 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c @@ -27,6 +27,12 @@ static void gm20b_pmu_recv(struct nvkm_pmu *pmu) { + if (!pmu->queue) { + nvkm_warn(&pmu->subdev, + "recv function called while no firmware set!\n"); + return; + } + nvkm_msgqueue_recv(pmu->queue); } |