From 1f1c60d5b577377d07863f3e0891e63a0a56a3ad Mon Sep 17 00:00:00 2001 From: Xinyun Liu Date: Thu, 7 Jun 2018 22:48:40 +0800 Subject: [PATCH] drm/i915/gvt: Avoid dereference a potential null pointer Add sanity check for up_irq_info. Signed-off-by: Xinyun Liu Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/gvt/interrupt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.30.2