minigbm: add more error handling especially for oom
This change also fixes a potential prime_fd leak in mediatek backend. BUG=b:201110412 TEST=CQ Change-Id: Ia3e10c94b536f83ecfb6580666103fe654bbc616 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3188852 Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org> Tested-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Chia-I Wu <olv@google.com>
This commit is contained in:
parent
7fae5d05e6
commit
afdf87dcd4
7 changed files with 64 additions and 6 deletions
|
|
@ -243,7 +243,15 @@ static int cross_domain_init(struct driver *drv)
|
|||
return -ENOTSUP;
|
||||
|
||||
priv = calloc(1, sizeof(*priv));
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->metadata_cache = drv_array_init(sizeof(struct bo_metadata));
|
||||
if (!priv->metadata_cache) {
|
||||
ret = -ENOMEM;
|
||||
goto free_private;
|
||||
}
|
||||
|
||||
priv->ring_addr = MAP_FAILED;
|
||||
drv->priv = priv;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue