Skip to content

Commit

Permalink
drm/i915/selftests: Fix return value check in live_breadcrumbs_smoket…
Browse files Browse the repository at this point in the history
…est()

[ Upstream commit 10c1f0c ]

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 <hulkci@huawei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/33c46ef24cd547d0ad21dc106441491a@intel.com
[tursulin: Wrap commit text, fix Fixes: tag.]
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 8f4caef)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zhihao Cheng authored and gregkh committed Jun 10, 2021
1 parent 8d614ee commit 4cf297e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/selftests/i915_request.c
Expand Up @@ -1391,8 +1391,8 @@ static int live_breadcrumbs_smoketest(void *arg)

for (n = 0; n < smoke[0].ncontexts; n++) {
smoke[0].contexts[n] = live_context(i915, file);
if (!smoke[0].contexts[n]) {
ret = -ENOMEM;
if (IS_ERR(smoke[0].contexts[n])) {
ret = PTR_ERR(smoke[0].contexts[n]);
goto out_contexts;
}
}
Expand Down

0 comments on commit 4cf297e

Please sign in to comment.