diff mbox series

[5/5] Fixing a Possible Null Pointer Dereference.

Message ID 20200824034556.26626-5-nischal.varide@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/5] Fixing Possible Null Pointer Dereference | expand

Commit Message

Nischal Varide Aug. 24, 2020, 3:45 a.m. UTC
Fixing a Possible Null Pointer Dereference in intel_crt.c.
Introduced a Null Check for dev_priv pointer before dereferencing.

Signed-off-by: Nischal Varide <nischal.varide@intel.com>
---
 drivers/gpu/drm/i915/display/intel_crt.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
index 5b4510ce5693..b5777fdc8cac 100644
--- a/drivers/gpu/drm/i915/display/intel_crt.c
+++ b/drivers/gpu/drm/i915/display/intel_crt.c
@@ -504,6 +504,9 @@  static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
 	bool ret;
 	u32 save_adpa;
 
+	if (!(dev_priv))
+		return false;
+
 	/*
 	 * Doing a force trigger causes a hpd interrupt to get sent, which can
 	 * get us stuck in a loop if we're polling: