[Intel-gfx] [PATCH 2/5] Critical-KlockWork-Fixes-intel_display.c-NullDeref
Nischal Varide
nischal.varide at intel.com
Wed Aug 19 04:34:06 UTC 2020
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 <nischal.varide at intel.com>
---
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;
}
--
2.26.0
More information about the Intel-gfx
mailing list