drm/nouveau/acr/ga102: fix NULL vs IS_ERR() check in ga102_acr_wpr_parse()
Subsystems (4)
PATCH 1/1 drm/nouveau/acr/ga102: fix NULL vs IS_ERR() check in ga102_acr_wpr_parse()
The nvkm_acr_lsfw_add() function never returns NULL, it returns error pointers. Update the check to match.
Fixes 4b569ded09fd ("drm/nouveau/acr/ga102: initial support")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c +4 -2
@@ -218,11 +218,13 @@ static int ga102_acr_wpr_parse(struct nvkm_acr *acr) {const struct wpr_header_v2 *hdr = (void *)acr->wpr_fw->data; +struct nvkm_acr_lsfw *lsfw;while (hdr->wpr.falcon_id !=WPR_HEADER_V1_FALCON_ID_INVALID ) {wpr_header_v2_dump (&acr->subdev, hdr); -if (!nvkm_acr_lsfw_add (NULL , acr,NULL , (hdr++)->wpr.falcon_id)) -return -ENOMEM ; + lsfw =nvkm_acr_lsfw_add (NULL , acr,NULL , (hdr++)->wpr.falcon_id); +if (IS_ERR (lsfw)) +return PTR_ERR (lsfw); }return 0 ;
Signature · 1 line
2.47.2
Quoted 5 lines · Dan Carpenter
The
nvkm_acr_lsfw_add()function never returns NULL, it returns error pointers. Update the check to match.Fixes 4b569ded09fd ("drm/nouveau/acr/ga102: initial support")Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Nirmoy Das <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/nouveau/nvkm/subdev/acr/ga102.c +4
-2@@ -218,11 +218,13 @@ static int ga102_acr_wpr_parse(struct nvkm_acr *acr) {const struct wpr_header_v2 *hdr = (void *)acr->wpr_fw->data; +struct nvkm_acr_lsfw *lsfw;while (hdr->wpr.falcon_id !=WPR_HEADER_V1_FALCON_ID_INVALID ) {wpr_header_v2_dump (&acr->subdev, hdr); -if (!nvkm_acr_lsfw_add (NULL , acr,NULL , (hdr++)->wpr.falcon_id)) -return -ENOMEM ; + lsfw =nvkm_acr_lsfw_add (NULL , acr,NULL , (hdr++)->wpr.falcon_id); +if (IS_ERR (lsfw)) +return PTR_ERR (lsfw); }return 0 ;