Commit e87197fb authored by Dan Carpenter's avatar Dan Carpenter Committed by Zhenyu Wang

drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()

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

Fixes: 97ea6565 ("drm/i915/gvt: Parse default state to update reg whitelist")
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/Ysftoia2BPUyqVcD@kiliAcked-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent d72d69ab
......@@ -3115,9 +3115,9 @@ void intel_gvt_update_reg_whitelist(struct intel_vgpu *vgpu)
continue;
vaddr = shmem_pin_map(engine->default_state);
if (IS_ERR(vaddr)) {
gvt_err("failed to map %s->default state, err:%zd\n",
engine->name, PTR_ERR(vaddr));
if (!vaddr) {
gvt_err("failed to map %s->default state\n",
engine->name);
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment