drm/i915: prevent crash with .disable_display parameter
authorClint Taylor <[email protected]>
Wed, 18 Jan 2017 21:38:43 +0000 (13:38 -0800)
committerJani Nikula <[email protected]>
Wed, 25 Jan 2017 10:42:16 +0000 (12:42 +0200)
The .disable_display parameter was causing a fatal crash when fbdev
was dereferenced during driver init.

V1: protection in i915_drv.c
V2: Moved protection to intel_fbdev.c

Fixes: 43cee314345a ("drm/i915/fbdev: Limit the global async-domain synchronization")
Testcase: igt/drv_module_reload/basic-no-display
Cc: Chris Wilson <[email protected]>
Signed-off-by: Clint Taylor <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Chris Wilson <[email protected]>
Cc: Lukas Wunner <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: <[email protected]> # v4.8+
Signed-off-by: Chris Wilson <[email protected]>
(cherry picked from commit 5b8cd0755f8a06a851c436a013e7be0823fb155a)
Signed-off-by: Jani Nikula <[email protected]>
drivers/gpu/drm/i915/intel_fbdev.c

index beb08982dc0b5c3ea9711de7220c383e6ea41b92..8cf2d80f22540a35dc4245a842d8473ce7d852d9 100644 (file)
@@ -742,6 +742,9 @@ void intel_fbdev_initial_config_async(struct drm_device *dev)
 {
        struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
+       if (!ifbdev)
+               return;
+
        ifbdev->cookie = async_schedule(intel_fbdev_initial_config, ifbdev);
 }