The SUBMIT_ERROR() macro turns the error code negative.  This extra '-'
operation turns it back to positive EINVAL again.  The error code is
passed to ERR_PTR() and since positive values are not an IS_ERR() it
eventually will lead to an oops.  Delete the '-'.

Fixes: 866e43b945bf ("drm/msm: UAPI error reporting")
Signed-off-by: Dan Carpenter <[email protected]>
---
 drivers/gpu/drm/msm/msm_gem_submit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c 
b/drivers/gpu/drm/msm/msm_gem_submit.c
index dee470403036..3e9aa2cc38ef 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -509,7 +509,7 @@ static struct drm_syncobj **msm_parse_deps(struct 
msm_gem_submit *submit,
                }
 
                if (syncobj_desc.flags & ~MSM_SUBMIT_SYNCOBJ_FLAGS) {
-                       ret = -SUBMIT_ERROR(EINVAL, submit, "invalid syncobj 
flags: %x", syncobj_desc.flags);
+                       ret = SUBMIT_ERROR(EINVAL, submit, "invalid syncobj 
flags: %x", syncobj_desc.flags);
                        break;
                }
 
-- 
2.47.2

Reply via email to