Message ID | 20221110094445.2930509-3-cuigaosheng1@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix IS_ERR() vs NULL check for drm | expand |
On 10/11/2022 11:44, Gaosheng Cui wrote: > The msm_gem_get_vaddr() returns an ERR_PTR() on failure, we should > use IS_ERR() to check the return value. > > Fixes: 6a8bd08d0465 ("drm/msm: add sudo flag to submit ioctl") > Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> > --- > drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c > index 3c537c0016fa..0abc802e8d5f 100644 > --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c > @@ -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 > * submit_reloc() > */ > - if (WARN_ON(!ptr)) > + if (WARN_ON(IS_ERR(ptr))) > return; > > for (i = 0; i < dwords; i++) { Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
On 11/10/2022 1:44 AM, Gaosheng Cui wrote: > The msm_gem_get_vaddr() returns an ERR_PTR() on failure, we should > use IS_ERR() to check the return value. > > Fixes: 6a8bd08d0465 ("drm/msm: add sudo flag to submit ioctl") > Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> > --- > drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 3c537c0016fa..0abc802e8d5f 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -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 * submit_reloc() */ - if (WARN_ON(!ptr)) + if (WARN_ON(IS_ERR(ptr))) return; for (i = 0; i < dwords; i++) {
The msm_gem_get_vaddr() returns an ERR_PTR() on failure, we should use IS_ERR() to check the return value. Fixes: 6a8bd08d0465 ("drm/msm: add sudo flag to submit ioctl") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)