Skip to content

Commit 10c1f0c

Browse files
Zhihao Chengjnikula
authored andcommitted
drm/i915/selftests: Fix return value check in live_breadcrumbs_smoketest()
In case of error, the function live_context() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 52c0fdb ("drm/i915: Replace global breadcrumbs with per-context interrupt tracking") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zhihao Cheng <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] [tursulin: Wrap commit text, fix Fixes: tag.] Signed-off-by: Tvrtko Ursulin <[email protected]> (cherry picked from commit 8f4caef) Signed-off-by: Jani Nikula <[email protected]>
1 parent 8124c8a commit 10c1f0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/selftests/i915_request.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,8 +1592,8 @@ static int live_breadcrumbs_smoketest(void *arg)
15921592

15931593
for (n = 0; n < smoke[0].ncontexts; n++) {
15941594
smoke[0].contexts[n] = live_context(i915, file);
1595-
if (!smoke[0].contexts[n]) {
1596-
ret = -ENOMEM;
1595+
if (IS_ERR(smoke[0].contexts[n])) {
1596+
ret = PTR_ERR(smoke[0].contexts[n]);
15971597
goto out_contexts;
15981598
}
15991599
}

0 commit comments

Comments
 (0)