Skip to content

Commit 6dc8613

Browse files
committed
Clear new MMIO tracking buffer space
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
1 parent cc1d72c commit 6dc8613

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/internal.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ void ocxl_default_afu_error_handler(ocxl_afu_h afu, ocxl_err error, const char *
182182
* Grow a buffer geometrically
183183
*
184184
* @param afu the AFU that owns the buffer
185-
* @param buffer [in/out] the buffer to grow
186-
* @param [in/out] the number of elements in the buffer
185+
* @param buffer [in,out] the buffer to grow
186+
* @param [in,out] count the number of elements in the buffer
187187
* @param size the size of a buffer element
188188
* @param initial_count the initial number of elements in the buffer
189189
*/
@@ -198,6 +198,8 @@ ocxl_err grow_buffer(ocxl_afu *afu, void **buffer, uint16_t *count, size_t size,
198198
return rc;
199199
}
200200

201+
memset((char *)temp + *count * size, '\0', new_count - *count);
202+
201203
*buffer = temp;
202204
*count = new_count;
203205

0 commit comments

Comments
 (0)