}
                }
  
-               obj = error->ring[i].ctx;
-               if (obj) {
 +              if ((obj = error->ring[i].hws)) {
 +                      err_printf(m, "%s --- HW Status = 0x%08x\n",
 +                                 dev_priv->ring[i].name,
 +                                 obj->gtt_offset);
 +                      offset = 0;
 +                      for (elt = 0; elt < PAGE_SIZE/16; elt += 4) {
 +                              err_printf(m, "[%04x] %08x %08x %08x %08x\n",
 +                                         offset,
 +                                         obj->pages[0][elt],
 +                                         obj->pages[0][elt+1],
 +                                         obj->pages[0][elt+2],
 +                                         obj->pages[0][elt+3]);
 +                                      offset += 16;
 +                      }
 +              }
 +
+               if ((obj = error->ring[i].ctx)) {
                        err_printf(m, "%s --- HW Context = 0x%08x\n",
                                   dev_priv->ring[i].name,
                                   obj->gtt_offset);
                        return NULL;
  
                obj = ring->scratch.obj;
-               if (acthd >= i915_gem_obj_ggtt_offset(obj) &&
+               if (obj != NULL &&
+                   acthd >= i915_gem_obj_ggtt_offset(obj) &&
                    acthd < i915_gem_obj_ggtt_offset(obj) + obj->base.size)
 -                      return i915_error_object_create(dev_priv, obj);
 +                      return i915_error_ggtt_object_create(dev_priv, obj);
        }
  
        seqno = ring->get_seqno(ring, false);