* [bug report] drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context
@ 2019-08-27 9:40 Dan Carpenter
2019-08-27 9:45 ` Chris Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-08-27 9:40 UTC (permalink / raw)
To: chris; +Cc: intel-gfx
Hello Chris Wilson,
The patch 75b974a859e5: "drm/i915/selftests: Teach igt_gpu_fill_dw()
to take intel_context" from Aug 24, 2019, leads to the following
static checker warning:
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:402 igt_ctx_exec()
error: 'ce' dereferencing possible ERR_PTR()
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
388 dw = 0;
389 while (!time_after(jiffies, end_time)) {
390 struct i915_gem_context *ctx;
391 struct intel_context *ce;
392
393 ctx = live_context(i915, file);
394 if (IS_ERR(ctx)) {
395 err = PTR_ERR(ctx);
396 goto out_unlock;
397 }
398
399 ce = i915_gem_context_get_engine(ctx, engine->legacy_idx);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
New assignment. Smatch thinks it can be ERR_PTR(-EINVAL)
400
401 if (!obj) {
402 obj = create_test_object(ce->vm, file, &objects);
^^^^^^
Dereference.
403 if (IS_ERR(obj)) {
404 err = PTR_ERR(obj);
405 intel_context_put(ce);
406 goto out_unlock;
407 }
408 }
409
410 err = gpu_fill(ce, obj, dw);
411 intel_context_put(ce);
412
413 if (err) {
414 pr_err("Failed to fill dword %lu [%lu/%lu] with gpu (%s) in ctx %u [full-ppgtt? %s], err=%d\n",
415 ndwords, dw, max_dwords(obj),
416 engine->name, ctx->hw_id,
417 yesno(!!ctx->vm), err);
418 goto out_unlock;
419 }
See also:
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:410 igt_ctx_exec() error: 'ce' dereferencing possible ERR_PTR()
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:528 igt_shared_ctx_exec() error: 'ce' dereferencing possible ERR_PTR()
drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:534 igt_shared_ctx_exec() error: 'ce' dereferencing possible ERR_PTR()
regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context
2019-08-27 9:40 [bug report] drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context Dan Carpenter
@ 2019-08-27 9:45 ` Chris Wilson
0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2019-08-27 9:45 UTC (permalink / raw)
To: Dan Carpenter; +Cc: intel-gfx
Quoting Dan Carpenter (2019-08-27 10:40:16)
> Hello Chris Wilson,
>
> The patch 75b974a859e5: "drm/i915/selftests: Teach igt_gpu_fill_dw()
> to take intel_context" from Aug 24, 2019, leads to the following
> static checker warning:
>
> drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c:402 igt_ctx_exec()
> error: 'ce' dereferencing possible ERR_PTR()
>
> drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
> 388 dw = 0;
> 389 while (!time_after(jiffies, end_time)) {
> 390 struct i915_gem_context *ctx;
> 391 struct intel_context *ce;
> 392
> 393 ctx = live_context(i915, file);
> 394 if (IS_ERR(ctx)) {
> 395 err = PTR_ERR(ctx);
> 396 goto out_unlock;
> 397 }
> 398
> 399 ce = i915_gem_context_get_engine(ctx, engine->legacy_idx);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> New assignment. Smatch thinks it can be ERR_PTR(-EINVAL)
It can't be from successful construction of the live_context().
GEM_BUG_ON(IS_ERR(ce)) I guess.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-27 9:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-27 9:40 [bug report] drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context Dan Carpenter
2019-08-27 9:45 ` Chris Wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.