vrend: do not accept to insert resource 0

These leads to later crashes

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 75f71b6f73
commit 1146468715
  1. 7
      src/vrend_object.c

@ -187,10 +187,15 @@ void *vrend_object_lookup(struct util_hash_table *handle_hash,
int vrend_resource_insert(void *data, uint32_t handle)
{
struct vrend_object *obj = CALLOC_STRUCT(vrend_object);
struct vrend_object *obj;
if (!handle)
return 0;
obj = CALLOC_STRUCT(vrend_object);
if (!obj)
return 0;
obj->handle = handle;
obj->data = data;
util_hash_table_set(res_hash, intptr_to_pointer(obj->handle), obj);

Loading…
Cancel
Save