From patchwork Mon Aug 24 03:45:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11732819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBE5614E5 for ; Mon, 24 Aug 2020 10:41:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D440C206B5 for ; Mon, 24 Aug 2020 10:41:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D440C206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 368516E1CE; Mon, 24 Aug 2020 10:41:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 973026E1CE for ; Mon, 24 Aug 2020 10:41:54 +0000 (UTC) IronPort-SDR: GoODEv5m/gZX+ZboIxz9q4ZnXRmZ4rB+M9Ycwo53eCbVr6NRngnmeZ911ZmscKg028eup1FohA r4LZmDI480dw== X-IronPort-AV: E=McAfee;i="6000,8403,9722"; a="153285900" X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="153285900" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 03:41:54 -0700 IronPort-SDR: eh4Fq+IWBhj6dVGp+2S7hBi5/kMac3g9N+Af03qFZ2tI55XwUvPiWR3LWQhdKfe8V4dfh9L807 VBWXmfvoevWg== X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="473869513" Received: from unknown (HELO john.iind.intel.com) ([10.223.74.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Aug 2020 03:41:52 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Mon, 24 Aug 2020 09:15:52 +0530 Message-Id: <20200824034556.26626-1-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/5] Fixing Possible Null Pointer Dereference X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" There is a possble Null Pointer dereference in intel_atomic.c and this patch fixes the same by introducting a check to old_state, new_state old_conn_state and new_conn_state variables. Signed-off-by: Nischal Varide --- drivers/gpu/drm/i915/display/intel_atomic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 630f49b7aa01..ab58f061c8a7 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -132,6 +132,9 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn, to_intel_digital_connector_state(old_state); struct drm_crtc_state *crtc_state; + if (!(new_state && new_conn_state && old_state && old_conn_state)) + return 0; + intel_hdcp_atomic_check(conn, old_state, new_state); intel_psr_atomic_check(conn, old_state, new_state); @@ -192,6 +195,8 @@ intel_connector_needs_modeset(struct intel_atomic_state *state, old_conn_state = drm_atomic_get_old_connector_state(&state->base, connector); new_conn_state = drm_atomic_get_new_connector_state(&state->base, connector); + if (!(old_conn_state && new_conn_state)) + return 0; return old_conn_state->crtc != new_conn_state->crtc || (new_conn_state->crtc && From patchwork Mon Aug 24 03:45:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11732821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC20E913 for ; Mon, 24 Aug 2020 10:41:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C4426206B5 for ; Mon, 24 Aug 2020 10:41:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4426206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D06556E1D3; Mon, 24 Aug 2020 10:41:56 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABD696E1CE for ; Mon, 24 Aug 2020 10:41:55 +0000 (UTC) IronPort-SDR: 1lbgfkd/Vwz3ERj7giC5zWqDwNvR/0FNemdPDAVy6DzXYN1HIil5Ixn/FzfniucnYI17qgkmHp fG+wJy5860EQ== X-IronPort-AV: E=McAfee;i="6000,8403,9722"; a="153285902" X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="153285902" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 03:41:55 -0700 IronPort-SDR: yMq5wWDSL9zhAPqOB/pdQgZmtCg5gXbqXe4OzndX7gHZ80HnElYG1K9Xbb7Wrt7shgTBOpiJxZ J8ErX08CxtUQ== X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="473869518" Received: from unknown (HELO john.iind.intel.com) ([10.223.74.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Aug 2020 03:41:54 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Mon, 24 Aug 2020 09:15:53 +0530 Message-Id: <20200824034556.26626-2-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200824034556.26626-1-nischal.varide@intel.com> References: <20200824034556.26626-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/5] Fixing Possible Null Pointer Dereference. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" A Possible Null Pointer Dereference of a Pointer obj is handled in intel_displa.c .This patch introduced a check on pointer obj before dereferencing Signed-off-by: Nischal Varide --- drivers/gpu/drm/i915/display/intel_display.c | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7d50b7177d40..30d5ab3f098d 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -2265,9 +2265,9 @@ intel_pin_and_fence_fb_obj(struct drm_framebuffer *fb, pinctl = 0; if (HAS_GMCH(dev_priv)) pinctl |= PIN_MAPPABLE; - - vma = i915_gem_object_pin_to_display_plane(obj, - alignment, view, pinctl); + if (obj) + vma = i915_gem_object_pin_to_display_plane(obj, + alignment, view, pinctl); if (IS_ERR(vma)) goto err; @@ -11309,10 +11309,13 @@ static u32 intel_cursor_base(const struct intel_plane_state *plane_state) const struct drm_i915_gem_object *obj = intel_fb_obj(fb); u32 base; - if (INTEL_INFO(dev_priv)->display.cursor_needs_physical) - base = sg_dma_address(obj->mm.pages->sgl); - else - base = intel_plane_ggtt_offset(plane_state); + if (obj) { + + if (INTEL_INFO(dev_priv)->display.cursor_needs_physical) + base = sg_dma_address(obj->mm.pages->sgl); + else + base = intel_plane_ggtt_offset(plane_state); + } return base + plane_state->color_plane[0].offset; } @@ -17166,10 +17169,9 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb, unsigned num_clips) { struct drm_i915_gem_object *obj = intel_fb_obj(fb); - - i915_gem_object_flush_if_display(obj); + if (obj) + i915_gem_object_flush_if_display(obj); intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB); - return 0; } From patchwork Mon Aug 24 03:45:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11732827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E2C7913 for ; Mon, 24 Aug 2020 10:42:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46BA52074D for ; Mon, 24 Aug 2020 10:42:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46BA52074D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEE316E1D7; Mon, 24 Aug 2020 10:42:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 262FC6E1CF for ; Mon, 24 Aug 2020 10:41:57 +0000 (UTC) IronPort-SDR: 4u4cqHx+DPUtcDOV9jF81QTQpu711TBkUUvI6cNdWOD/jEpCSRKClVMjk5YQInjiRnovBM9klg FjyKfIo1BI3Q== X-IronPort-AV: E=McAfee;i="6000,8403,9722"; a="153285906" X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="153285906" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 03:41:56 -0700 IronPort-SDR: 9q3POlV+9xgOJ4O9ZPCatKcaytEE3vJlIf+RpIklQmuhXYZ2Yi3ea7dfahqd620hIeg9a2bpaU RTql7V7710Eg== X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="473869531" Received: from unknown (HELO john.iind.intel.com) ([10.223.74.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Aug 2020 03:41:55 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Mon, 24 Aug 2020 09:15:54 +0530 Message-Id: <20200824034556.26626-3-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200824034556.26626-1-nischal.varide@intel.com> References: <20200824034556.26626-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/5] Fixing a Possible Null Pointer Dereference. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This Patch addresses a Possible Null Pointer Dereference of variables new_stae, new_conn_state and old_state, old_conn_state in intel_sdvo.c Signed-off-by: Nischal Varide --- drivers/gpu/drm/i915/display/intel_sdvo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index 2da4388e1540..186a2d695bb6 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -2505,6 +2505,9 @@ static int intel_sdvo_atomic_check(struct drm_connector *conn, struct intel_sdvo_connector_state *new_state = to_intel_sdvo_connector_state(new_conn_state); + if (!(new_conn_state && old_conn_state && old_state && new_state)) + return 0; + if (new_conn_state->crtc && (memcmp(&old_state->tv, &new_state->tv, sizeof(old_state->tv)) || memcmp(&old_conn_state->tv, &new_conn_state->tv, sizeof(old_conn_state->tv)))) { From patchwork Mon Aug 24 03:45:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11732823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94CEF14E5 for ; Mon, 24 Aug 2020 10:42:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D66E206B5 for ; Mon, 24 Aug 2020 10:42:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D66E206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C017E6E1CF; Mon, 24 Aug 2020 10:41:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FC7D6E1CF for ; Mon, 24 Aug 2020 10:41:58 +0000 (UTC) IronPort-SDR: XGYa28ggePLS52Wk7uj64Kph7yIXm95DGJgeWKVP7UTKc2z0VHo9ONy4szdrDgsZc77povx5V7 1cY72bDIJoSA== X-IronPort-AV: E=McAfee;i="6000,8403,9722"; a="153285908" X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="153285908" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 03:41:58 -0700 IronPort-SDR: cgFN6zQF25AFGZxYM5k7lFlJcCoHDg+BJf7Fk/u10GHv4Z/6UYURlfQ0aTnwCkuiQgd5GONdLz rUtn7rbxRptQ== X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="473869535" Received: from unknown (HELO john.iind.intel.com) ([10.223.74.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Aug 2020 03:41:57 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Mon, 24 Aug 2020 09:15:55 +0530 Message-Id: <20200824034556.26626-4-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200824034556.26626-1-nischal.varide@intel.com> References: <20200824034556.26626-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 4/5] Fixing Possible Null Pointer Dereference. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" A possible Null Pointer dereference of new_state,old_state, new_crtc_state pointers from intel_tv.c is handled in this patch. Signed-off-by: Nischal Varide --- drivers/gpu/drm/i915/display/intel_tv.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_tv.c b/drivers/gpu/drm/i915/display/intel_tv.c index 777032d9697b..5600d146ae81 100644 --- a/drivers/gpu/drm/i915/display/intel_tv.c +++ b/drivers/gpu/drm/i915/display/intel_tv.c @@ -1836,17 +1836,20 @@ static int intel_tv_atomic_check(struct drm_connector *connector, struct drm_connector_state *old_state; new_state = drm_atomic_get_new_connector_state(state, connector); - if (!new_state->crtc) - return 0; - old_state = drm_atomic_get_old_connector_state(state, connector); new_crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc); + if (!(old_state && new_state && new_crtc_state)) + return 0; + + if (!new_state->crtc) + return 0; + if (old_state->tv.mode != new_state->tv.mode || - old_state->tv.margins.left != new_state->tv.margins.left || - old_state->tv.margins.right != new_state->tv.margins.right || - old_state->tv.margins.top != new_state->tv.margins.top || - old_state->tv.margins.bottom != new_state->tv.margins.bottom) { + old_state->tv.margins.left != new_state->tv.margins.left || + old_state->tv.margins.right != new_state->tv.margins.right || + old_state->tv.margins.top != new_state->tv.margins.top || + old_state->tv.margins.bottom != new_state->tv.margins.bottom) { /* Force a modeset. */ new_crtc_state->connectors_changed = true; From patchwork Mon Aug 24 03:45:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11732825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57C3414E5 for ; Mon, 24 Aug 2020 10:42:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4042F206B5 for ; Mon, 24 Aug 2020 10:42:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4042F206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E5046E1D6; Mon, 24 Aug 2020 10:42:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 158426E1D7 for ; Mon, 24 Aug 2020 10:42:00 +0000 (UTC) IronPort-SDR: IwO2WZCluA4JiHa034LB6L5wOB1uij4W/8pH5/uuy7otu2+JJeYMK1f6qvYUAqTmFYUvKTycVy fb7y800PtWog== X-IronPort-AV: E=McAfee;i="6000,8403,9722"; a="153285912" X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="153285912" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 03:41:59 -0700 IronPort-SDR: afX54lFYX1v9+g3HwEAnDCbTx8Ciaq7LWZ9LGZ1KHIke4fiXjWmpGy0uo6LOyMfg81ug5xABl1 R77C5Q6G1S+w== X-IronPort-AV: E=Sophos;i="5.76,348,1592895600"; d="scan'208";a="473869541" Received: from unknown (HELO john.iind.intel.com) ([10.223.74.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 24 Aug 2020 03:41:58 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Mon, 24 Aug 2020 09:15:56 +0530 Message-Id: <20200824034556.26626-5-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200824034556.26626-1-nischal.varide@intel.com> References: <20200824034556.26626-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 5/5] Fixing a Possible Null Pointer Dereference. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- drivers/gpu/drm/i915/display/intel_crt.c | 3 +++ 1 file changed, 3 insertions(+) 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: