summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-07-06 14:50:20 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-07-06 14:50:20 +0000
commit5f3d71c2afe1c553b1c388aac3b59523d83e41c7 (patch)
tree0db4003fdafe846511081333550538d36e0351c1 /sys
parentb7e506b86a1d9691ff26019343ff523bfd30b393 (diff)
defer access of fb_info pointer in drm_fb_helper_hotplug_event()
Fixes a regression from rev 1.24 which lead to a page fault reported by Martin Ziemer. ok stsp@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drm_fb_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c
index 6ddad45c990..13929cc0b08 100644
--- a/sys/dev/pci/drm/drm_fb_helper.c
+++ b/sys/dev/pci/drm/drm_fb_helper.c
@@ -1958,7 +1958,7 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config);
*/
int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
{
- struct fb_info *fbi = fb_helper->fbdev;
+ struct fb_info *fbi;
int err = 0;
if (!drm_fbdev_emulation || !fb_helper)
@@ -1985,6 +1985,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
drm_setup_crtcs_fb(fb_helper);
mutex_unlock(&fb_helper->lock);
+ fbi = fb_helper->fbdev;
if (fbi->fbops && fbi->fbops->fb_set_par)
fbi->fbops->fb_set_par(fbi);
else