minigbm: populate errno for all code path of drv_bo_create
Error code triaging from drv_bo_create relies on errno. This patch fixes the missing generation of errno, so that cros_gralloc_driver::allocate can return the errno on failure. BUG=b:199524294 TEST=CtsNativeHardwareTestCases Change-Id: Ie6bf374d1a1c68800463b17ab00a08d859755641 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3163927 Tested-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
This commit is contained in:
parent
1f9b9000b7
commit
01b697472e
1 changed files with 2 additions and 0 deletions
2
drv.c
2
drv.c
|
|
@ -230,6 +230,7 @@ struct bo *drv_bo_new(struct driver *drv, uint32_t width, uint32_t height, uint3
|
|||
|
||||
if (!bo->meta.num_planes) {
|
||||
free(bo);
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -263,6 +264,7 @@ struct bo *drv_bo_create(struct driver *drv, uint32_t width, uint32_t height, ui
|
|||
}
|
||||
|
||||
if (ret) {
|
||||
errno = -ret;
|
||||
free(bo);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue