drm/i915: Skip the ERR_PTR error state
Although commitfb6f0b64e4
("drm/i915: Prevent machine hang from Broxton's vtd w/a and error capture") applied cleanly after a 24 month hiatus, the code had moved on with new methods for peeking and fetching the captured gpu info. Make sure we catch all uses of the stashed error state and avoid dereferencing the error pointer. v2: Move error pointer determination into i915_gpu_capture_state v3: Restore early check to avoid capturing and then throwing away subsequent GPU error states. Fixes:fb6f0b64e4
("drm/i915: Prevent machine hang from Broxton's vtd w/a and error capture") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181207110554.19897-1-chris@chris-wilson.co.uk (cherry picked from commite6154e4cb8
) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:

committed by
Jani Nikula

parent
1035f4a65f
commit
107c595c2a
@@ -521,7 +521,9 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
|
||||
ssize_t ret;
|
||||
|
||||
gpu = i915_first_error_state(i915);
|
||||
if (gpu) {
|
||||
if (IS_ERR(gpu)) {
|
||||
ret = PTR_ERR(gpu);
|
||||
} else if (gpu) {
|
||||
ret = i915_gpu_state_copy_to_buffer(gpu, buf, off, count);
|
||||
i915_gpu_state_put(gpu);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user