diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2011-07-30 15:43:48 +0900 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2011-07-30 16:38:01 +0900 |
commit | 75ee75c2115109c1385677c8a92f8ace27a48b60 (patch) | |
tree | dc1d838dc8a98c934b8951cdfeb7d206e2bda754 /gralloc_drm.c | |
parent | 1db540381c30f11ecb87995f8bb7e1ee0a3f1b9c (diff) | |
download | external_drm_gralloc-75ee75c2115109c1385677c8a92f8ace27a48b60.zip external_drm_gralloc-75ee75c2115109c1385677c8a92f8ace27a48b60.tar.gz external_drm_gralloc-75ee75c2115109c1385677c8a92f8ace27a48b60.tar.bz2 |
protect against NULL handle
Diffstat (limited to 'gralloc_drm.c')
-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 0e0943b..d67561f 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.c @@ -259,8 +259,11 @@ struct gralloc_drm_bo_t *gralloc_drm_bo_register(struct gralloc_drm_t *drm, { struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle); + if (!handle) + return NULL; + /* the buffer handle is passed to a new process */ - if (handle && unlikely(handle->data_owner != gralloc_drm_pid)) { + if (unlikely(handle->data_owner != gralloc_drm_pid)) { struct gralloc_drm_bo_t *bo; if (!create) |