@@ -87,7 +87,6 @@ int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size,
/* init chain */
memset(chain, 0, sizeof(*chain));
- memset(chain->first_addr, 0, chain->size);
chain->first_addr = addr;
chain->size = a_chain_size;
chain->p_cons_elem = chain->first_addr;
@@ -97,6 +96,8 @@ int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size,
chain->last_addr = (void *)
((uint8_t *)addr + (elem_size * (chain->n_elems -1)));
+ /* Note: since we are using MAP_ANONYMOUS the chain is zeroed for us */
+
return 0;
}