Commit afc87750 authored by Bruno Chevalier's avatar Bruno Chevalier

Move allocation behind check for ext_buffer wihtout zero_copy.

parent ef97994f
......@@ -66,17 +66,18 @@ struct pico_frame *pico_frame_copy(struct pico_frame *f)
static struct pico_frame *pico_frame_do_alloc(uint32_t size, int zerocopy, int ext_buffer)
struct pico_frame *p = PICO_ZALLOC(sizeof(struct pico_frame));
struct pico_frame *p = NULL;
uint32_t frame_buffer_size = size;
if (!p)
return NULL;
if (ext_buffer && !zerocopy) {
/* external buffer implies zerocopy flag! */
return NULL;
p = PICO_ZALLOC(sizeof(struct pico_frame));
if (!p)
return NULL;
if (!zerocopy) {
unsigned int align = size % sizeof(uint32_t);
/* Ensure that usage_count starts on an aligned address */
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