Commit 11464687 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Dave Airlie

vrend: do not accept to insert resource 0

These leads to later crashes
Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@gmail.com>
parent 75f71b6f
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment