]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 30 Nov 2023 07:27:01 +0000 (10:27 +0300)
committerMaxime Ripard <mripard@kernel.org>
Thu, 30 Nov 2023 08:16:59 +0000 (09:16 +0100)
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
drivers/gpu/drm/imagination/pvr_device.c

index e1dcc4e420876abca81ead9c15cd0a7d78614e08..5389aea7ff2161b42f4dbf2025cd0e9502ee2ec9 100644 (file)
@@ -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