提交 3e971e59 编写于 作者: D Dan Carpenter 提交者: Zheng Zengkai

drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

stable inclusion
from stable-v5.10.132
commit 636e5dbaf097aaf66b6234f0b10598d44ccc8a87
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YS3T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=636e5dbaf097aaf66b6234f0b10598d44ccc8a87

--------------------------------

[ Upstream commit 896dcabd ]

The shmem_pin_map() function doesn't return error pointers, it returns
NULL.

Fixes: be1cb55a ("drm/i915/gt: Keep a no-frills swappable copy of the default context state")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NMatthew Auld <matthew.auld@intel.com>
Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220708094104.GL2316@kadam
(cherry picked from commit d50f5a10)
Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 655bf5a8
...@@ -4788,8 +4788,8 @@ static int live_lrc_layout(void *arg) ...@@ -4788,8 +4788,8 @@ static int live_lrc_layout(void *arg)
continue; continue;
hw = shmem_pin_map(engine->default_state); hw = shmem_pin_map(engine->default_state);
if (IS_ERR(hw)) { if (!hw) {
err = PTR_ERR(hw); err = -ENOMEM;
break; break;
} }
hw += LRC_STATE_OFFSET / sizeof(*hw); hw += LRC_STATE_OFFSET / sizeof(*hw);
...@@ -4965,8 +4965,8 @@ static int live_lrc_fixed(void *arg) ...@@ -4965,8 +4965,8 @@ static int live_lrc_fixed(void *arg)
continue; continue;
hw = shmem_pin_map(engine->default_state); hw = shmem_pin_map(engine->default_state);
if (IS_ERR(hw)) { if (!hw) {
err = PTR_ERR(hw); err = -ENOMEM;
break; break;
} }
hw += LRC_STATE_OFFSET / sizeof(*hw); hw += LRC_STATE_OFFSET / sizeof(*hw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册