* [PATCH 1/1] dri: vc4: set error code on failure
@ 2016-12-03 9:17 Pan Bian
2016-12-09 23:18 ` Eric Anholt
0 siblings, 1 reply; 2+ messages in thread
From: Pan Bian @ 2016-12-03 9:17 UTC (permalink / raw)
To: Eric Anholt, David Airlie, dri-devel; +Cc: linux-kernel, 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
Signed-off-by: Pan Bian <bianpan2016@163.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] dri: vc4: set error code on failure
2016-12-03 9:17 [PATCH 1/1] dri: vc4: set error code on failure Pan Bian
@ 2016-12-09 23:18 ` Eric Anholt
0 siblings, 0 replies; 2+ messages in thread
From: Eric Anholt @ 2016-12-09 23:18 UTC (permalink / raw)
To: Pan Bian, David Airlie, dri-devel; +Cc: linux-kernel, Pan Bian
[-- Attachment #1: Type: text/plain, Size: 489 bytes --]
Pan Bian <bianpan2016@163.com> writes:
> 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@163.com>
This one was already fixed in b2cdeb19f16ad984eb5bb9193f793d05a8101511
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-09 23:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03 9:17 [PATCH 1/1] dri: vc4: set error code on failure Pan Bian
2016-12-09 23:18 ` Eric Anholt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).