[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437395369-749-1-git-send-email-sudipm.mukherjee@gmail.com>
Date: Mon, 20 Jul 2015 17:59:29 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Daniel Vetter <daniel.vetter@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
David Airlie <airlied@...ux.ie>
Cc: linux-kernel@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH] drm/i915: fix possible null pointer dereference
We were dereferencing dev first and then checking if it is NULL. Lets
check for NULL first and then dereference.
Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
---
drivers/gpu/drm/i915/i915_debugfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index bc817da..f316e49 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4100,12 +4100,13 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data)
{
struct drm_device *dev = m->private;
struct drm_connector *connector;
- struct list_head *connector_list = &dev->mode_config.connector_list;
+ struct list_head *connector_list;
struct intel_dp *intel_dp;
if (!dev)
return -ENODEV;
+ connector_list = &dev->mode_config.connector_list;
list_for_each_entry(connector, connector_list, head) {
if (connector->connector_type !=
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists