summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gvt
diff options
context:
space:
mode:
authorXinyun Liu <xinyun.liu@intel.com>2018-06-07 22:48:40 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2018-06-11 15:03:36 +0800
commit1f1c60d5b577377d07863f3e0891e63a0a56a3ad (patch)
tree6344a315fc600fc93c1046cc7a5902674704f839 /drivers/gpu/drm/i915/gvt
parent0766e2efc6968179ceec9828caf740ec0ac58a15 (diff)
drm/i915/gvt: Avoid dereference a potential null pointer
Add sanity check for up_irq_info. Signed-off-by: Xinyun Liu <xinyun.liu@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt')
-rw-r--r--drivers/gpu/drm/i915/gvt/interrupt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/interrupt.c b/drivers/gpu/drm/i915/gvt/interrupt.c
index 7a041b368f68..1d79596da510 100644
--- a/drivers/gpu/drm/i915/gvt/interrupt.c
+++ b/drivers/gpu/drm/i915/gvt/interrupt.c
@@ -350,7 +350,8 @@ static void update_upstream_irq(struct intel_vgpu *vgpu,
clear_bits |= (1 << bit);
}
- WARN_ON(!up_irq_info);
+ if (WARN_ON(!up_irq_info))
+ return;
if (up_irq_info->group == INTEL_GVT_IRQ_INFO_MASTER) {
u32 isr = i915_mmio_reg_offset(up_irq_info->reg_base);