drm/fb-helper: Check fb_deferred_io_init() return value
authorJavier Martinez Canillas <javierm@redhat.com>
Sat, 21 Jan 2023 19:24:17 +0000 (20:24 +0100)
committerJavier Martinez Canillas <javierm@redhat.com>
Tue, 24 Jan 2023 10:13:07 +0000 (11:13 +0100)
The fb_deferred_io_init() can fail and return an errno code but currently
there is no check for its return value.

Fix that and propagate to errno to the caller in the case of a failure.

Fixes: d536540f304c ("drm/fb-helper: Add generic fbdev emulation .fb_probe function")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230121192418.2814955-3-javierm@redhat.com
drivers/gpu/drm/drm_fbdev_generic.c

index ab869566927958108c0b220655c6cb45e2877bf6..97e00f27d2d68c15b06673e43ee2702a110173a7 100644 (file)
@@ -223,7 +223,9 @@ static int drm_fbdev_fb_probe(struct drm_fb_helper *fb_helper,
                fbi->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
 
                fbi->fbdefio = &drm_fbdev_defio;
-               fb_deferred_io_init(fbi);
+               ret = fb_deferred_io_init(fbi);
+               if (ret)
+                       return ret;
        } else {
                /* buffer is mapped for HW framebuffer */
                ret = drm_client_buffer_vmap(fb_helper->buffer, &map);