Skip to contentSkip to conversation

dri: vc4: set error code on failure

PATCH In review Pan Bian 2 participants 2 messages Dec 3, 2016 – Dec 9, 2016

Subsystems (3)
lore
Share & tools
lore

Pan Bian

author
#0 lore raw

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

---
 drivers/gpu/drm/vc4/vc4_gem.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vc4/vc4_gem.c +1 -0
index 47a095f..2592a94 100644
@@ -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;
 	}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · Pan Bian

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

This one was already fixed in b2cdeb19f16ad984eb5bb9193f793d05a8101511

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel