Commit 6e8a9965 authored by Gaosheng Cui's avatar Gaosheng Cui Committed by Rob Clark

drm/msm: Fix IS_ERR_OR_NULL() vs NULL check in a5xx_submit_in_rb()

The msm_gem_get_vaddr() returns an ERR_PTR() on failure, and a null
is catastrophic here, so we should use IS_ERR_OR_NULL() to check
the return value.

Fixes: 6a8bd08d ("drm/msm: add sudo flag to submit ioctl")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarAbhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: default avatarAkhil P Oommen <quic_akhilpo@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/547712/Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent bd846cee
...@@ -89,7 +89,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit ...@@ -89,7 +89,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit
* since we've already mapped it once in * since we've already mapped it once in
* submit_reloc() * submit_reloc()
*/ */
if (WARN_ON(!ptr)) if (WARN_ON(IS_ERR_OR_NULL(ptr)))
return; return;
for (i = 0; i < dwords; i++) { for (i = 0; i < dwords; i++) {
......
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