Skip to content
Commit 009634e4 authored by Rob Herring's avatar Rob Herring
Browse files

android: fix gralloc_handle_create() problems



There's a number of problems with gralloc_handle_create starting with it
doesn't even compile. More importantly, it doesn't really create (i.e.
allocate) a handle. It allocates a native_handle_t, copies it to a
struct gralloc_handle_t on the stack and returns the struct (not a ptr).
So the caller still has to allocate a struct gralloc_handle_t to hold
the returned struct.

Rework gralloc_handle_create() to allocate a new handle and return the
pointer to the allocated handle. Callers should free the handle with
native_handle_close() and native_handle_delete(). In the interest of
making gralloc_handle_t opaque, return a native_handle_t ptr instead.

Reviewed-by: default avatarRobert Foss <robert.foss@collabora.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 86c62e49
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment