Skip to content

Commit 1c338ed

Browse files
author
Ben Skeggs
committed
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 <[email protected]>
1 parent 86e18eb commit 1c338ed

File tree

1 file changed

+5
-1
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/acr

1 file changed

+5
-1
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ struct nvkm_acr_lsfw *
5858
nvkm_acr_lsfw_add(const struct nvkm_acr_lsf_func *func, struct nvkm_acr *acr,
5959
struct nvkm_falcon *falcon, enum nvkm_acr_lsf_id id)
6060
{
61-
struct nvkm_acr_lsfw *lsfw = nvkm_acr_lsfw_get(acr, id);
61+
struct nvkm_acr_lsfw *lsfw;
62+
63+
if (!acr)
64+
return ERR_PTR(-ENOSYS);
6265

66+
lsfw = nvkm_acr_lsfw_get(acr, id);
6367
if (lsfw && lsfw->func) {
6468
nvkm_error(&acr->subdev, "LSFW %d redefined\n", id);
6569
return ERR_PTR(-EEXIST);

0 commit comments

Comments
 (0)