diff mbox series

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

Message ID 20200814024950.26830-3-nischal.varide@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/8] Critical KlockWork Error - Fixes - intel_cdclk.c - Possible NullPointerDereference1 | expand

Commit Message

Nischal Varide Aug. 14, 2020, 2:49 a.m. UTC
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

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();