From patchwork Wed Aug 19 04:34:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11723543 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 635B2722 for ; Wed, 19 Aug 2020 11:30:53 +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 4B00C206FA for ; Wed, 19 Aug 2020 11:30:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B00C206FA 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 7C00389B05; Wed, 19 Aug 2020 11:30:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A47889255 for ; Wed, 19 Aug 2020 11:30:47 +0000 (UTC) IronPort-SDR: 1dUmbcTZOfNwkk2pXWdE7aA9sRB4VplrfUiQmV4AbEKC/2k/Cy6fM3yCKBXYAAfRmBZK+AwpBq VKS1AjF/9elQ== X-IronPort-AV: E=McAfee;i="6000,8403,9717"; a="135157579" X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="135157579" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 04:30:46 -0700 IronPort-SDR: ZwV97iaW9jOi95nSxcM6Y81dRjiZnICfNPTWlFUl+jOKRxmhZ10R9GnHq5UXorR/XbCWf7Ijh1 GsqrFwDH4NkA== X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="472206414" 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; 19 Aug 2020 04:30:45 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Wed, 19 Aug 2020 10:04:05 +0530 Message-Id: <20200819043409.26010-1-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/5] Critical-KclockWork-Fixes-intel_atomi.c-PossibleNull 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 fixes the Klocwork errors and the Current fix is avoiding Possible Null Pointer Dereference Signed-off-by: Nischal Varide Reported-by: kernel test robot --- drivers/gpu/drm/i915/display/intel_atomic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index 630f49b7aa01..cf51f1005ec1 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 && @@ -418,7 +423,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, */ /* fail if required scalers > available scalers */ - if (num_scalers_need > intel_crtc->num_scalers){ + if (num_scalers_need > intel_crtc->num_scalers) { drm_dbg_kms(&dev_priv->drm, "Too many scaling requests %d > %d\n", num_scalers_need, intel_crtc->num_scalers); From patchwork Wed Aug 19 04:34:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11723541 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 668C616B1 for ; Wed, 19 Aug 2020 11:30:51 +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 4B47B206FA for ; Wed, 19 Aug 2020 11:30:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B47B206FA 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 469F089AEA; Wed, 19 Aug 2020 11:30:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 59E088996F for ; Wed, 19 Aug 2020 11:30:48 +0000 (UTC) IronPort-SDR: mNTNsNN3PyRkFZs8NJWjfbQi52A5p2lrUMr/JJWyen4VPCjlt7gG/x4ww5wZ6VvX5XAMTOUGAd +79yogS99PMw== X-IronPort-AV: E=McAfee;i="6000,8403,9717"; a="135157581" X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="135157581" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 04:30:48 -0700 IronPort-SDR: xJYNCsyptUgmE8r1xb7rq9Lxyf0c/rPeQEaq7wBoIyBbWrWnDB65skvPM2CCMdX+MeipgI9yLA m2/e7OabxizQ== X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="472206429" 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; 19 Aug 2020 04:30:47 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Wed, 19 Aug 2020 10:04:06 +0530 Message-Id: <20200819043409.26010-2-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200819043409.26010-1-nischal.varide@intel.com> References: <20200819043409.26010-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/5] Critical-KlockWork-Fixes-intel_display.c-NullDeref 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 fixes the Critical KlockWork Error and here a possible NuLL Pointer dereferencing is addressed. A check has been added before dereferencing. Signed-off-by: Nischal Varide Reported-by: kernel test robot Reported-by: kernel test robot Reported-by: Dan Carpenter --- 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 2ddabf92adde..cc59c5e94698 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; @@ -11269,10 +11269,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; } @@ -17126,10 +17129,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 Wed Aug 19 04:34:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11723545 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 AAFCC14F6 for ; Wed, 19 Aug 2020 11:30:54 +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 92FE1206FA for ; Wed, 19 Aug 2020 11:30:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92FE1206FA 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 76A6689BA5; Wed, 19 Aug 2020 11:30:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBB2C89C13 for ; Wed, 19 Aug 2020 11:30:49 +0000 (UTC) IronPort-SDR: JCCj8GqpXY8feFImC/kFXVQH0zN7m64KJGCD43z50kpGe8wN7maU4GVR6d4/9I4Q7GrbmRMgzf opxYfcywFqPA== X-IronPort-AV: E=McAfee;i="6000,8403,9717"; a="135157582" X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="135157582" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 04:30:49 -0700 IronPort-SDR: r5+QGHnHwLsGQuNu+s4OXdWKHGBpkJE7XutC1N2HsscAHtrrVL9eCidOuTXEOnv2O4yvAQC/dd emUZWxcniJOg== X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="472206443" 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; 19 Aug 2020 04:30:48 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Wed, 19 Aug 2020 10:04:07 +0530 Message-Id: <20200819043409.26010-3-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200819043409.26010-1-nischal.varide@intel.com> References: <20200819043409.26010-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/5] Critical-KlockWorks-Fix-intel_sdvo.c-Possible-Null 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 fixes Critical Klockwork errors and in this case a Possible Null Pointer Dereferencing is addressed with a Check before Dereferencing 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 Wed Aug 19 04:34:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11723547 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 DE19914F6 for ; Wed, 19 Aug 2020 11:30:55 +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 C6626206FA for ; Wed, 19 Aug 2020 11:30:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6626206FA 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 7C16589C13; Wed, 19 Aug 2020 11:30:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C09B89BA5 for ; Wed, 19 Aug 2020 11:30:51 +0000 (UTC) IronPort-SDR: 3SbfZBZU0TMHAiYLfwssVVasQMSYSXc8hfOz6dSiz1ify9MygUE9Xk71IjjoeWLtZlqk3sKSgQ 2erU5do6XgKg== X-IronPort-AV: E=McAfee;i="6000,8403,9717"; a="135157583" X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="135157583" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 04:30:51 -0700 IronPort-SDR: 5ONVDmahuixEeS2Fcp4kn/zshBBSZSm2eFfeJnoP04Cx/URgI79VrmnFvu8sf7IGiTtvT/FiBL B07RifT7nkWg== X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="472206462" 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; 19 Aug 2020 04:30:49 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Wed, 19 Aug 2020 10:04:08 +0530 Message-Id: <20200819043409.26010-4-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200819043409.26010-1-nischal.varide@intel.com> References: <20200819043409.26010-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 4/5] Critical-KlockWork-Fix-intel_tv.c-Possible-Null 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 fixes the Critical Klock work Error and in this case a Possible Null Pointer Dereference has been addressed with a Null check before dereferencing Signed-off-by: Nischal Varide Reported-by: kernel test robot Reported-by: Dan Carpenter --- 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 Wed Aug 19 04:34:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nischal Varide X-Patchwork-Id: 11723549 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 DB064722 for ; Wed, 19 Aug 2020 11:30: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 C3DC6206FA for ; Wed, 19 Aug 2020 11:30:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3DC6206FA 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 ECCC389C28; Wed, 19 Aug 2020 11:30:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id B10A789C18 for ; Wed, 19 Aug 2020 11:30:52 +0000 (UTC) IronPort-SDR: CY+HPyQ1Jy+CipA6BRJFy+5OJQJA8tKMtpvF9G7qorOQRnhNRfUP6XYPHO5BO9AHaA479WzkbF G3LA6HmI7AMQ== X-IronPort-AV: E=McAfee;i="6000,8403,9717"; a="135157586" X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="135157586" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2020 04:30:52 -0700 IronPort-SDR: ZVQjTUwL0XW3K+xN5W0lSI/E3UZlbyaVN/hq14t4KbvC6niz3DUzMruTl3u3tFOHV8jR2f23CM HWlW3i0ASWVA== X-IronPort-AV: E=Sophos;i="5.76,331,1592895600"; d="scan'208";a="472206484" 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; 19 Aug 2020 04:30:51 -0700 From: Nischal Varide To: intel-gfx@lists.freedesktop.org, nischal.varide@intel.com Date: Wed, 19 Aug 2020 10:04:09 +0530 Message-Id: <20200819043409.26010-5-nischal.varide@intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200819043409.26010-1-nischal.varide@intel.com> References: <20200819043409.26010-1-nischal.varide@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 5/5] Critical-KlockWorks-Fix-intel_crt.c-Possible-Null 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 fixes the Critical KlockWork Errors and here a Possible Null Pointer Dereferencing is addressed with a Null Pointer check 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: