diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2011-07-15 10:46:06 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2011-07-18 10:52:40 +0800 |
commit | 68ea7da097be193e44f6d9fcbde6b1daf0e703c1 (patch) | |
tree | 16747e5606d2544d40a81f2512b54b02fcb4cb8e | |
parent | cbd6279acf355522da6a859e062c64efb4fbc9d4 (diff) | |
download | external_drm_gralloc-68ea7da097be193e44f6d9fcbde6b1daf0e703c1.zip external_drm_gralloc-68ea7da097be193e44f6d9fcbde6b1daf0e703c1.tar.gz external_drm_gralloc-68ea7da097be193e44f6d9fcbde6b1daf0e703c1.tar.bz2 |
improve bo validation a little bit
-rw-r--r-- | gralloc_drm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gralloc_drm.c b/gralloc_drm.c index 710a56f..af33986 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.c @@ -246,7 +246,10 @@ struct gralloc_drm_bo_t *gralloc_drm_bo_validate(struct gralloc_drm_t *drm, struct gralloc_drm_bo_t *bo; /* create the struct gralloc_drm_bo_t locally */ - bo = drm->drv->alloc(drm->drv, handle); + if (handle->name) + bo = drm->drv->alloc(drm->drv, handle); + else /* an invalid handle */ + bo = NULL; if (bo) { bo->drm = drm; bo->imported = 1; |