drm/nouveau/acr: Abort loading ACR if no firmware was found
Subsystems (3)
PATCH 1/1 drm/nouveau/acr: Abort loading ACR if no firmware was found
This fixes a NULL pointer access inside nvkm_acr_oneinit in case necessary firmware files couldn't be loaded.
--- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +1 -1
@@ -224,7 +224,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev)u64 falcons;int ret, i; -if (list_empty (&acr->hsfw)) { +if (list_empty (&acr->hsfw) || !acr->func->wpr_layout) {nvkm_debug (subdev,"No HSFW(s)\n" );nvkm_acr_cleanup (acr);return 0 ;
Signature · 1 line
2.40.1
Quoted 16 lines · Karol Herbst
This fixes a NULL pointer access inside
nvkm_acr_oneinitin case necessary firmware files couldn't be loaded.Fixes 4b569ded09fd ("drm/nouveau/acr/ga102: initial support")Signed-off-by Karol Herbst <[email protected]>--- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +0
-0
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c nvkm_acr_oneinit(struct nvkm_subdev *subdev) · line 227
Quoted 5 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +1
-1@@ -224,7 +224,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev)u64 falcons;int ret, i; -if (list_empty (&acr->hsfw)) { +if (list_empty (&acr->hsfw) || !acr->func->wpr_layout) {
Now thinking about this, it should probably also check acr->func...
Quoted 6 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +0
-1nvkm_debug (subdev,"No HSFW(s)\n" );nvkm_acr_cleanup (acr);return 0 ; --2.40.1
Quoted 21 lines · Karol Herbst
Quoted 19 lines · Karol Herbst
This fixes a NULL pointer access inside
nvkm_acr_oneinitin case necessary firmware files couldn't be loaded.Fixes 4b569ded09fd ("drm/nouveau/acr/ga102: initial support")Signed-off-by Karol Herbst <[email protected]>--- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +0
-0@@ -224,7 +224,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev)u64 falcons;int ret, i;
Quoted 4 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c nvkm_acr_oneinit(struct nvkm_subdev *subdev) · line 227
Quoted 2 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +1
-1-if (list_empty (&acr->hsfw)) { +if (list_empty (&acr->hsfw) || !acr->func->wpr_layout) {Now thinking about this, it should probably also check
acr->func...
with that fixed if you think you need it,
Quoted 8 lines
Quoted 7 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +0
-1nvkm_debug (subdev,"No HSFW(s)\n" );nvkm_acr_cleanup (acr);return 0 ; --2.40.1
Quoted 23 lines · Dave Airlie
Quoted 21 lines · Karol Herbst
Quoted 19 lines · Karol Herbst
This fixes a NULL pointer access inside
nvkm_acr_oneinitin case necessary firmware files couldn't be loaded.Fixes 4b569ded09fd ("drm/nouveau/acr/ga102: initial support")Signed-off-by Karol Herbst <[email protected]>--- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +0
-0@@ -224,7 +224,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev)u64 falcons;int ret, i;
Quoted 6 lines
Quoted 4 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c nvkm_acr_oneinit(struct nvkm_subdev *subdev) · line 227
Quoted 2 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +1
-1-if (list_empty (&acr->hsfw)) { +if (list_empty (&acr->hsfw) || !acr->func->wpr_layout) {Now thinking about this, it should probably also check
acr->func...with that fixed if you think you need it,
I don't *think* you do. I believe modprobe will fail for any case it can be NULL.
Quoted 11 lines
Reviewed-by Dave Airlie <[email protected]>Quoted 8 lines
Quoted 7 lines
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +0
-1nvkm_debug (subdev,"No HSFW(s)\n" );nvkm_acr_cleanup (acr);return 0 ; --2.40.1