summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-11-30 10:27:01 +0300
committerMaxime Ripard <mripard@kernel.org>2023-11-30 09:16:59 +0100
commit9ee33dc47772724ff583b060bb37c62b92b2d9c4 (patch)
treede15c1e4916dd3e99393af38e6e47ba0cbadb222
parent03219a3aa6c89f1cbb6624907f32d6939a1ffeb0 (diff)
drm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware()drm-misc-next-2023-11-30
The pvr_build_firmware_filename() function returns NULL on error. It doesn't return error pointers. Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/384288de-a779-46c7-869d-b3c63462e12b@moroto.mountain
-rw-r--r--drivers/gpu/drm/imagination/pvr_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c
index e1dcc4e42087..5389aea7ff21 100644
--- a/drivers/gpu/drm/imagination/pvr_device.c
+++ b/drivers/gpu/drm/imagination/pvr_device.c
@@ -286,8 +286,8 @@ pvr_request_firmware(struct pvr_device *pvr_dev)
filename = pvr_build_firmware_filename(pvr_dev, "powervr/rogue",
PVR_FW_VERSION_MAJOR);
- if (IS_ERR(filename))
- return PTR_ERR(filename);
+ if (!filename)
+ return -ENOMEM;
/*
* This function takes a copy of &filename, meaning we can free our