[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480756647-3673-1-git-send-email-bianpan2016@163.com>
Date: Sat, 3 Dec 2016 17:17:27 +0800
From: Pan Bian <bianpan2016@....com>
To: Eric Anholt <eric@...olt.net>, David Airlie <airlied@...ux.ie>,
dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org, Pan Bian <bianpan2016@....com>
Subject: [PATCH 1/1] dri: vc4: set error code on failure
Function vc4_cl_lookup_bos() does not set the error code when
drm_malloc_ab() returns a NULL pointer, and will return 0 (indicates
success). This patch fixes the bug, assigning "-ENOMEM" to the return
variable ret on the path that memory allocation fails.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188631
Signed-off-by: Pan Bian <bianpan2016@....com>
---
drivers/gpu/drm/vc4/vc4_gem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 47a095f..2592a94 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -544,6 +544,7 @@ struct vc4_hang_state {
handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t));
if (!handles) {
+ ret = -ENOMEM;
DRM_ERROR("Failed to allocate incoming GEM handles\n");
goto fail;
}
--
1.9.1
Powered by blists - more mailing lists