Commit 3613a9be authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Skeggs

drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new()

We accidentally set "psb" which is a no-op instead of "*psb" so it
generates a static checker warning.  We should probably set it before
the first error return so that it's always initialized.

Fixes: 923f1bd2 ("drm/nouveau/secboot/gm20b: add secure boot support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 176ada03
...@@ -129,6 +129,7 @@ gm20b_secboot_new(struct nvkm_device *device, int index, ...@@ -129,6 +129,7 @@ gm20b_secboot_new(struct nvkm_device *device, int index,
struct gm200_secboot *gsb; struct gm200_secboot *gsb;
struct nvkm_acr *acr; struct nvkm_acr *acr;
*psb = NULL;
acr = acr_r352_new(BIT(NVKM_SECBOOT_FALCON_FECS) | acr = acr_r352_new(BIT(NVKM_SECBOOT_FALCON_FECS) |
BIT(NVKM_SECBOOT_FALCON_PMU)); BIT(NVKM_SECBOOT_FALCON_PMU));
if (IS_ERR(acr)) if (IS_ERR(acr))
...@@ -137,10 +138,8 @@ gm20b_secboot_new(struct nvkm_device *device, int index, ...@@ -137,10 +138,8 @@ gm20b_secboot_new(struct nvkm_device *device, int index,
acr->optional_falcons = BIT(NVKM_SECBOOT_FALCON_PMU); acr->optional_falcons = BIT(NVKM_SECBOOT_FALCON_PMU);
gsb = kzalloc(sizeof(*gsb), GFP_KERNEL); gsb = kzalloc(sizeof(*gsb), GFP_KERNEL);
if (!gsb) { if (!gsb)
psb = NULL;
return -ENOMEM; return -ENOMEM;
}
*psb = &gsb->base; *psb = &gsb->base;
ret = nvkm_secboot_ctor(&gm20b_secboot, acr, device, index, &gsb->base); ret = nvkm_secboot_ctor(&gm20b_secboot, acr, device, index, &gsb->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment