diff mbox series

[2/2] drm/fbdev: Ensure that one of the probe functions is defined

Message ID 20241002-vc4_fbdev_fix-v1-2-8737bd11b147@raspberrypi.com (mailing list archive)
State New, archived
Headers show
Series drm: Fix up and error handling after fbdev changes | expand

Commit Message

Dave Stevenson Oct. 2, 2024, 3:06 p.m. UTC
Commit 5d08c44e47b9 ("drm/fbdev: Add memory-agnostic fbdev client")
added the newer probe function, but left a path where no probe
function was called. fb_helper->fb would then be NULL and the strcpy
would throw a NULL pointer exception.

Handle that error case.

Fixes: 5d08c44e47b9 ("drm/fbdev: Add memory-agnostic fbdev client")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index d5e8994345bb..9c8868d7b9d3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1635,6 +1635,8 @@  static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
 		ret = dev->driver->fbdev_probe(fb_helper, &sizes);
 	else if (fb_helper->funcs)
 		ret = fb_helper->funcs->fb_probe(fb_helper, &sizes);
+	else
+		ret = -EINVAL;
 	if (ret < 0)
 		return ret;