[Intel-gfx] [PATCH 3/8] Critical KlockWork Error - Fixes - intel_fbdev.c - Possible NullPointerDereference1

Nischal Varide nischal.varide at intel.com
Fri Aug 14 02:49:45 UTC 2020


---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index bd39eb6a21b8..ec4f82559fc1 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -595,9 +595,11 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
 	 * been restored from swap. If the object is stolen however, it will be
 	 * full of whatever garbage was left in there.
 	 */
-	if (state == FBINFO_STATE_RUNNING &&
-	    intel_fb_obj(&ifbdev->fb->base)->stolen)
+	if (ifbdev->fb && intel_fb_obj(&ifbdev->fb->base)) {
+	    if (state == FBINFO_STATE_RUNNING &&
+		    intel_fb_obj(&ifbdev->fb->base)->stolen)
 		memset_io(info->screen_base, 0, info->screen_size);
+	}
 
 	drm_fb_helper_set_suspend(&ifbdev->helper, state);
 	console_unlock();
-- 
2.26.0



More information about the Intel-gfx mailing list