提交 c9811d0f 编写于 作者: W Wei Yongjun 提交者: Rob Clark

drm/msm: fix return value check in _msm_gem_kernel_new()

In case of error, the function msm_gem_get_vaddr() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: 8223286d ("drm/msm: Add a helper function for in-kernel
buffer allocations")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NRob Clark <robdclark@gmail.com>
上级 f44001e2
......@@ -1045,10 +1045,10 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size,
}
vaddr = msm_gem_get_vaddr(obj);
if (!vaddr) {
if (IS_ERR(vaddr)) {
msm_gem_put_iova(obj, aspace);
drm_gem_object_unreference(obj);
return ERR_PTR(-ENOMEM);
return ERR_CAST(vaddr);
}
if (bo)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册