aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs2020-01-29 11:20:34 +1000
committerBen Skeggs2020-01-29 15:49:56 +1000
commit1c338ed5e52b62737a9d45f37f085bdbb367821b (patch)
tree26bc91aa8335c59a9a7775cd18771bce6fd7246a /drivers/gpu
parent86e18ebd87072ed1ba6ecd86271e7a712115d579 (diff)
drm/nouveau/acr: return error when registering LSF if ACR not supported
This fixes an oops on TU11x GPUs where SEC2 attempts to register its falcon, and triggers a NULL-pointer deref because ACR isn't yet supported. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
index 9896462960ea..07d1830126ab 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
@@ -58,8 +58,12 @@ struct nvkm_acr_lsfw *
nvkm_acr_lsfw_add(const struct nvkm_acr_lsf_func *func, struct nvkm_acr *acr,
struct nvkm_falcon *falcon, enum nvkm_acr_lsf_id id)
{
- struct nvkm_acr_lsfw *lsfw = nvkm_acr_lsfw_get(acr, id);
+ struct nvkm_acr_lsfw *lsfw;
+
+ if (!acr)
+ return ERR_PTR(-ENOSYS);
+ lsfw = nvkm_acr_lsfw_get(acr, id);
if (lsfw && lsfw->func) {
nvkm_error(&acr->subdev, "LSFW %d redefined\n", id);
return ERR_PTR(-EEXIST);