static struct aux_payloads *dal_ddc_aux_payloads_create(struct dc_context *ctx, uint32_t count) { struct aux_payloads *payloads; payloads = kzalloc(sizeof(struct aux_payloads), GFP_KERNEL); if (!payloads) return NULL; if (dal_vector_construct( &payloads->payloads, ctx, count, sizeof(struct aux_payload))) return payloads; kfree(payloads); return NULL; }
struct aux_payloads *dal_ddc_aux_payloads_create(uint32_t count) { struct aux_payloads *payloads; payloads = dal_alloc(sizeof(struct aux_payloads)); if (!payloads) return NULL; if (dal_vector_construct( &payloads->payloads, count, sizeof(struct aux_payloads))) return payloads; dal_free(payloads); return NULL; }
struct vector *dal_vector_create( struct dc_context *ctx, uint32_t capacity, uint32_t struct_size) { struct vector *vector = kzalloc(sizeof(struct vector), GFP_KERNEL); if (vector == NULL) return NULL; if (dal_vector_construct(vector, ctx, capacity, struct_size)) return vector; BREAK_TO_DEBUGGER(); kfree(vector); return NULL; }